From: Mark Wielaard Date: Thu, 12 Sep 2013 13:16:13 +0000 (+0200) Subject: libdwfl: proc_maps_report should not fclose the given file. X-Git-Tag: elfutils-0.157~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cc3924843b9bc04ff7aae3b491b16bd1bd175613;p=thirdparty%2Felfutils.git 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 --- diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog index df7a50f82..d325475ad 100644 --- a/libdwfl/ChangeLog +++ b/libdwfl/ChangeLog @@ -1,3 +1,8 @@ +2013-09-12 Mark Wielaard + + * linux-proc-maps.c (proc_maps_report): Don't fclose FILE in + bad_report. + 2013-09-12 Mark Wielaard * dwfl_module_getdwarf.c (find_symtab): Call elf_getdata with diff --git a/libdwfl/linux-proc-maps.c b/libdwfl/linux-proc-maps.c index 67ff5091d..10946b9c3 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; }