Hello,

We've found a memory leak in libunwind-coredump. Some of the variables
weren't being deallocated in _UCD_destroy().

Please find attached a patch that fixes the bug.

Thanks,
Felipe
From a9189599087b0b12e687ca6061e3f56abf0827f3 Mon Sep 17 00:00:00 2001
From: Felipe Cerqueira <[email protected]>
Date: Mon, 14 Aug 2017 13:50:58 -0700
Subject: [PATCH 1/1] Fix memory leak in libunwind-coredump.

_UCD_destroy() was not freeing all variables from UCD_info.
---
 src/coredump/_UCD_destroy.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/coredump/_UCD_destroy.c b/src/coredump/_UCD_destroy.c
index 5aff989..ddc36ec 100644
--- a/src/coredump/_UCD_destroy.c
+++ b/src/coredump/_UCD_destroy.c
@@ -44,7 +44,9 @@ _UCD_destroy (struct UCD_info *ui)
         close(phdr->backing_fd);
     }
 
+  free(ui->phdrs);
   free(ui->note_phdr);
+  free(ui->threads);
 
   free(ui);
 }
-- 

_______________________________________________
Libunwind-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/libunwind-devel

Reply via email to