diff options
| author | Roland McGrath <[email protected]> | 2008-04-06 01:57:32 +0000 |
|---|---|---|
| committer | Roland McGrath <[email protected]> | 2008-04-06 01:57:32 +0000 |
| commit | bfc01703fe30815b450526ebcfbb37ec9f5fe9c7 (patch) | |
| tree | da9fc99627a845a672cb689c4f3836b2df43bd3d /libdwfl/linux-proc-maps.c | |
| parent | 60982e6e9da662cf5c9d12c6d095738a9b2dcf68 (diff) | |
libdwfl/
* linux-proc-maps.c (proc_maps_report): Don't leak LAST_FILE.
Diffstat (limited to 'libdwfl/linux-proc-maps.c')
| -rw-r--r-- | libdwfl/linux-proc-maps.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libdwfl/linux-proc-maps.c b/libdwfl/linux-proc-maps.c index 6eaed39a..b4bb6cfc 100644 --- a/libdwfl/linux-proc-maps.c +++ b/libdwfl/linux-proc-maps.c @@ -1,5 +1,5 @@ /* Standard libdwfl callbacks for debugging a live Linux process. - Copyright (C) 2005, 2007 Red Hat, Inc. + Copyright (C) 2005, 2007, 2008 Red Hat, Inc. This file is part of Red Hat elfutils. Red Hat elfutils is free software; you can redistribute it and/or modify @@ -138,12 +138,12 @@ proc_maps_report (Dwfl *dwfl, FILE *f, GElf_Addr sysinfo_ehdr, pid_t pid) { if (last_file != NULL) { - if (INTUSE(dwfl_report_module) (dwfl, last_file, low, high) == NULL) - { - free (last_file); - return true; - } + Dwfl_Module *mod = INTUSE(dwfl_report_module) (dwfl, last_file, + low, high); + free (last_file); last_file = NULL; + if (unlikely (mod == NULL)) + return true; } return false; } |
