Skip to contentSkip to conversation

Debugger: free Pathname on error return path to fix memory leak

PATCH New Colin King 1 participant 1 message Sep 13, 2016 ACPI component architecture (acpica)

lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 Debugger: free Pathname on error return path to fix memory leak

From: Colin Ian King <colin.king(a)canonical.com>

On the error return path when AcpiGetObjectInfo fails the allocated pathname is not free'd leading to a memory leak. Free pathname to fix this.

Signed-off-by Colin Ian King <colin.king(a)canonical.com>
---
 source/components/debugger/dbmethod.c | 1 +
 1 file changed, 1 insertion(+)
source/components/debugger/dbmethod.c +1 -0
index 5756ecb..22a66d1 100644
@@ -551,6 +551,7 @@ AcpiDbWalkForExecute (
     Status = AcpiGetObjectInfo (ObjHandle, &ObjInfo);
     if (ACPI_FAILURE (Status))
     {
+        ACPI_FREE(Pathname);
         return (Status);
     }
 
Signature · 1 line
2.9.3