[PATCH] fwts: opal: fix memory leak of 'buf'.

Colin King colin.king at canonical.com
Thu Jul 4 16:08:06 UTC 2019


From: Colin Ian King <colin.king at canonical.com>

Each iteration is leaking an allocated buffer. Free it.

Addresses-Coverity: ("Resource leak")
Fixes: 80eda6b3aad3 ("fwts/opal: Reserved memory DT validation tests.")
Signed-off-by: Colin Ian King <colin.king at canonical.com>
---
 src/opal/reserv_mem.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/opal/reserv_mem.c b/src/opal/reserv_mem.c
index 69233b2c..8708295e 100644
--- a/src/opal/reserv_mem.c
+++ b/src/opal/reserv_mem.c
@@ -234,6 +234,7 @@ static int reserv_mem_limits_test(fwts_framework *fw)
 				buf);
 			ok = false;
 		}
+		free(buf);
 
 		if (skip)
 			continue;
-- 
2.20.1




More information about the fwts-devel mailing list