aboutsummaryrefslogtreecommitdiff
path: root/proc.c
diff options
context:
space:
mode:
authorPetr Machata <pmachata@redhat.com>2012-10-26 22:23:43 +0200
committerPetr Machata <pmachata@redhat.com>2012-10-26 22:23:43 +0200
commite677c7e0b79fc0af7c98436d924fefca7d43f359 (patch)
treecee3d07e8ac153f3043b4b7d4bd4317fa5afb7da /proc.c
parente655ccffc4ba7bba317b01700f8fc50461d8c4dd (diff)
downloadltrace-e677c7e0b79fc0af7c98436d924fefca7d43f359.tar.gz
Release unwind data
This plugs a leak
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/proc.c b/proc.c
index 3dab1e2..3a452ab 100644
--- a/proc.c
+++ b/proc.c
@@ -76,6 +76,15 @@ arch_dynlink_done(struct Process *proc)
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 @@ process_bare_destroy(struct Process *proc, int was_exec)
if (!was_exec) {
free(proc->filename);
unlist_process(proc);
+ destroy_unwind(proc);
}
}
@@ -193,6 +203,8 @@ private_process_destroy(struct Process *proc, int keep_filename)
dict_clear(proc->breakpoints);
proc->breakpoints = NULL;
}
+
+ destroy_unwind(proc);
}
void