]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
libdwfl: Don't leak memory in proc_maps_report when ENOEXEC.
authorMark Wielaard <mjw@redhat.com>
Sat, 13 Feb 2016 18:48:57 +0000 (19:48 +0100)
committerMark Wielaard <mjw@redhat.com>
Mon, 22 Feb 2016 11:14:44 +0000 (12:14 +0100)
We forgot to free last_file on error.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
libdwfl/ChangeLog
libdwfl/linux-proc-maps.c

index 903c0cc707e6f9e2f904db4147dcc3328b18f11a..69fd233755a020f6928867922090df813f6cfabd 100644 (file)
@@ -1,3 +1,7 @@
+2016-02-13  Mark Wielaard  <mjw@redhat.com>
+
+       * linux-proc-maps.c (proc_maps_report): Free last_file when ENOEXEC.
+
 2016-02-13  Mark Wielaard  <mjw@redhat.com>
 
        * frame_unwind.c (new_unwound): Check and return unwound.
index 9e7b2a21f107c4434fc68755132887614f53649e..94b26d59eb7a89a51c081cfa3a3bbe96b63373d3 100644 (file)
@@ -1,5 +1,5 @@
 /* Standard libdwfl callbacks for debugging a live Linux process.
-   Copyright (C) 2005-2010, 2013, 2014 Red Hat, Inc.
+   Copyright (C) 2005-2010, 2013, 2014, 2016 Red Hat, Inc.
    This file is part of elfutils.
 
    This file is free software; you can redistribute it and/or modify
@@ -218,6 +218,7 @@ proc_maps_report (Dwfl *dwfl, FILE *f, GElf_Addr sysinfo_ehdr, pid_t pid)
          || nread <= 0)
        {
          free (line);
+         free (last_file);
          return ENOEXEC;
        }