]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
libdwfl: proc_maps_report should not fclose the given file.
authorMark Wielaard <mjw@redhat.com>
Thu, 12 Sep 2013 13:16:13 +0000 (15:16 +0200)
committerMark Wielaard <mjw@redhat.com>
Thu, 12 Sep 2013 13:46:32 +0000 (15:46 +0200)
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
libdwfl/linux-proc-maps.c

index df7a50f82d9bbc228680e7304c1b1acf47f7ee7d..d325475adce34293f2a351f00af7d05201edf843 100644 (file)
@@ -1,3 +1,8 @@
+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
index 67ff5091d003942872218bbd6a4ebfafc251e263..10946b9c3b25f37bb5b1d2f65539e41ed1cf690a 100644 (file)
@@ -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;
            }