Release unwind data
This plugs a leak
diff --git a/proc.c b/proc.c
index 3dab1e2..3a452ab 100644
--- a/proc.c
+++ b/proc.c
@@ -76,6 +76,15 @@
static void add_process(struct Process *proc, int was_exec);
static void unlist_process(struct Process *proc);
+static void
+destroy_unwind(struct Process *proc)
+{
+#if defined(HAVE_LIBUNWIND)
+ _UPT_destroy(proc->unwind_priv);
+ unw_destroy_addr_space(proc->unwind_as);
+#endif /* defined(HAVE_LIBUNWIND) */
+}
+
static int
process_bare_init(struct Process *proc, const char *filename,
pid_t pid, int was_exec)
@@ -123,6 +132,7 @@
if (!was_exec) {
free(proc->filename);
unlist_process(proc);
+ destroy_unwind(proc);
}
}
@@ -193,6 +203,8 @@
dict_clear(proc->breakpoints);
proc->breakpoints = NULL;
}
+
+ destroy_unwind(proc);
}
void