summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Wielaard <mjw@redhat.com>2013-09-12 15:16:13 +0200
committerMark Wielaard <mjw@redhat.com>2013-09-12 15:46:32 +0200
commitcc3924843b9bc04ff7aae3b491b16bd1bd175613 (patch)
tree8e138a9b96f5d39ea5b81912bc29aecd855e0e39
parent2e73a8aec03499cda880db667e2570ebc0dd6810 (diff)
downloadelfutils-cc3924843b9bc04ff7aae3b491b16bd1bd175613.tar.gz
libdwfl: proc_maps_report should not fclose the given file.
Calling fclose only on bad_report, but not on other errors or success is confusing. The caller is always responsible for calling fclose on the given file. Otherwise flcose might be called twice (e.g. in dwfl_linux_proc_report). Signed-off-by: Mark Wielaard <mjw@redhat.com>
-rw-r--r--libdwfl/ChangeLog5
-rw-r--r--libdwfl/linux-proc-maps.c1
2 files changed, 5 insertions, 1 deletions
diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog
index df7a50f8..d325475a 100644
--- a/libdwfl/ChangeLog
+++ b/libdwfl/ChangeLog
@@ -1,5 +1,10 @@
2013-09-12 Mark Wielaard <mjw@redhat.com>
+ * linux-proc-maps.c (proc_maps_report): Don't fclose FILE in
+ bad_report.
+
+2013-09-12 Mark Wielaard <mjw@redhat.com>
+
* dwfl_module_getdwarf.c (find_symtab): Call elf_getdata with
aux_xndxscn, not xndxscn, for aux_symxndxdata.
diff --git a/libdwfl/linux-proc-maps.c b/libdwfl/linux-proc-maps.c
index 67ff5091..10946b9c 100644
--- a/libdwfl/linux-proc-maps.c
+++ b/libdwfl/linux-proc-maps.c
@@ -221,7 +221,6 @@ proc_maps_report (Dwfl *dwfl, FILE *f, GElf_Addr sysinfo_ehdr, pid_t pid)
{
bad_report:
free (line);
- fclose (f);
return -1;
}