[PATCH] acpi: dmar: free klog list on error

Colin King colin.king at canonical.com
Mon May 6 22:35:21 UTC 2013


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

Coverity CID #997269, Resource leak.

Need to free klog list before we return.

Signed-off-by: Colin Ian King <colin.king at canonical.com>
---
 src/acpi/dmar/dmar.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/acpi/dmar/dmar.c b/src/acpi/dmar/dmar.c
index bd6511b..6505a94 100644
--- a/src/acpi/dmar/dmar.c
+++ b/src/acpi/dmar/dmar.c
@@ -316,6 +316,7 @@ static int dmar_test1(fwts_framework *fw)
 		if (fwts_klog_scan(fw, klog, acpiinfo_check,
 			NULL, NULL, &errors)) {
                 	fwts_log_error(fw, "Failed to scan kernel log.");
+			fwts_klog_free(klog);
                 	return FWTS_ERROR;
 		}
 		if (errors == 0)
-- 
1.8.1.2




More information about the fwts-devel mailing list