Skip to contentSkip to conversation

seabios: acpi: fix memory leak in build_srat().

PATCH In review Isaku Yamahata 2 participants 2 messages Feb 12, 2010 – Feb 13, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 seabios: acpi: fix memory leak in build_srat().

numadata() is allocated for temporal use, but not freed. free it.

---
 src/acpi.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
src/acpi.c +2 -0
index dbdca79..e2a1153 100644
@@ -490,6 +490,7 @@ build_srat(void)
     srat = malloc_high(srat_size);
     if (!srat) {
         dprintf(1, "Not enough memory for srat table!\n");
+        free(numadata);
         return NULL;
     }
 
@@ -556,6 +557,7 @@ build_srat(void)
 
     build_header((void*)srat, SRAT_SIGNATURE, srat_size, 1);
 
+    free(numadata);
     return srat;
 }
 
Signature · 1 line
1.6.6.1
#1 lore raw
Quoted 2 lines · Isaku Yamahata

numadata() is allocated for temporal use, but not freed. free it.

Thanks.

-Kevin