aboutsummaryrefslogtreecommitdiff
path: root/libdwfl/dwfl_end.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>2008-08-25 22:55:17 +0000
committerRoland McGrath <roland@redhat.com>2008-08-25 22:55:17 +0000
commitb4d6f0f8064f2b706ea9035ef0393d8299671390 (patch)
tree58d3da51253302bc5b8f2198d8462942ff43f464 /libdwfl/dwfl_end.c
parentf729d77881262094d365d33ac51063e25a02e357 (diff)
downloadelfutils-b4d6f0f8064f2b706ea9035ef0393d8299671390.tar.gz
Fix up bogon and missing log entries from .pmachata.threads branch.
Diffstat (limited to 'libdwfl/dwfl_end.c')
-rw-r--r--libdwfl/dwfl_end.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/libdwfl/dwfl_end.c b/libdwfl/dwfl_end.c
index 4bd40052..429abb13 100644
--- a/libdwfl/dwfl_end.c
+++ b/libdwfl/dwfl_end.c
@@ -52,15 +52,20 @@
void
dwfl_end (Dwfl *dwfl)
{
- if (dwfl != NULL)
+ if (dwfl == NULL)
+ return;
+
+ free (dwfl->lookup_addr);
+ free (dwfl->lookup_module);
+ free (dwfl->lookup_segndx);
+
+ Dwfl_Module *next = dwfl->modulelist;
+ while (next != NULL)
{
- while (dwfl->modulelist != NULL)
- {
- Dwfl_Module *mod = dwfl->modulelist;
- dwfl->modulelist = mod->next;
- __libdwfl_module_free (mod);
- }
- free (dwfl->modules);
- free (dwfl);
+ Dwfl_Module *dead = next;
+ next = dead->next;
+ __libdwfl_module_free (dead);
}
+
+ free (dwfl);
}