summaryrefslogtreecommitdiff
path: root/libdwfl
diff options
context:
space:
mode:
authorMark Wielaard <mjw@redhat.com>2015-06-18 16:17:40 +0200
committerMark Wielaard <mjw@redhat.com>2015-06-19 13:09:42 +0200
commit9075ff6aebb67d9ef2a5b53d1ae35c55590edcf7 (patch)
tree39c7aed0af614a611014adb6793f3df672f95399 /libdwfl
parent90a7bd23b1f4ffcace0721634f97ce34553c2288 (diff)
downloadelfutils-9075ff6aebb67d9ef2a5b53d1ae35c55590edcf7.tar.gz
libdwfl: Don't leak fname if file is main file by another name in try_open.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
Diffstat (limited to 'libdwfl')
-rw-r--r--libdwfl/ChangeLog4
-rw-r--r--libdwfl/find-debuginfo.c3
2 files changed, 6 insertions, 1 deletions
diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog
index ca987833..5059be6d 100644
--- a/libdwfl/ChangeLog
+++ b/libdwfl/ChangeLog
@@ -1,5 +1,9 @@
2015-06-18 Mark Wielaard <mjw@redhat.com>
+ * find-debuginfo.c (try_open): Free fname on all failure paths.
+
+2015-06-18 Mark Wielaard <mjw@redhat.com>
+
* dwfl_module_getdwarf.c (find_symtab): Check shdr is not NULL and
sh_entsize is not zero.
diff --git a/libdwfl/find-debuginfo.c b/libdwfl/find-debuginfo.c
index c5233548..1faa494d 100644
--- a/libdwfl/find-debuginfo.c
+++ b/libdwfl/find-debuginfo.c
@@ -1,5 +1,5 @@
/* Standard find_debuginfo callback for libdwfl.
- Copyright (C) 2005-2010, 2014 Red Hat, Inc.
+ Copyright (C) 2005-2010, 2014, 2015 Red Hat, Inc.
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
@@ -62,6 +62,7 @@ try_open (const struct stat64 *main_stat,
&& st.st_dev == main_stat->st_dev)
{
/* This is the main file by another name. Don't look at it again. */
+ free (fname);
close (fd);
errno = ENOENT;
fd = -1;