This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
[PATCH] libdwfl: proc_maps_report should not fclose the given file.
- From: Mark Wielaard <mjw at redhat dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Thu, 12 Sep 2013 15:47:20 +0200
- Subject: [PATCH] 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>
---
libdwfl/ChangeLog | 5 +++++
libdwfl/linux-proc-maps.c | 1 -
2 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog
index df7a50f..d325475 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 67ff509..10946b9 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;
}
--
1.7.1