diff options
author | Petr Machata <pmachata@redhat.com> | 2012-10-26 22:23:43 +0200 |
---|---|---|
committer | Petr Machata <pmachata@redhat.com> | 2012-10-26 22:23:43 +0200 |
commit | e677c7e0b79fc0af7c98436d924fefca7d43f359 (patch) | |
tree | cee3d07e8ac153f3043b4b7d4bd4317fa5afb7da /proc.c | |
parent | e655ccffc4ba7bba317b01700f8fc50461d8c4dd (diff) | |
download | ltrace-e677c7e0b79fc0af7c98436d924fefca7d43f359.tar.gz |
Release unwind data
This plugs a leak
Diffstat (limited to 'proc.c')
-rw-r--r-- | proc.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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 |