From: Mark Wielaard Date: Sat, 13 Feb 2016 18:48:57 +0000 (+0100) Subject: libdwfl: Don't leak memory in proc_maps_report when ENOEXEC. X-Git-Tag: elfutils-0.166~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ee38add05d201eb79a36c89b92dddedbc909a1c7;p=thirdparty%2Felfutils.git libdwfl: Don't leak memory in proc_maps_report when ENOEXEC. We forgot to free last_file on error. Signed-off-by: Mark Wielaard --- diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog index 903c0cc70..69fd23375 100644 --- a/libdwfl/ChangeLog +++ b/libdwfl/ChangeLog @@ -1,3 +1,7 @@ +2016-02-13 Mark Wielaard + + * linux-proc-maps.c (proc_maps_report): Free last_file when ENOEXEC. + 2016-02-13 Mark Wielaard * frame_unwind.c (new_unwound): Check and return unwound. diff --git a/libdwfl/linux-proc-maps.c b/libdwfl/linux-proc-maps.c index 9e7b2a21f..94b26d59e 100644 --- a/libdwfl/linux-proc-maps.c +++ b/libdwfl/linux-proc-maps.c @@ -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; }