summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Hsieh <andrewhsieh@google.com>2012-10-31 14:14:32 -0700
committerAndrew Hsieh <andrewhsieh@google.com>2012-10-31 15:40:28 -0700
commit557fe9a2dd1d8836b0c2b8e82409f0923731117d (patch)
tree034af24412f8db212254129fe0bcd6699aa71dd4
parent101941576c52a1270c9c2d63ea95d48729d6cf96 (diff)
downloadandroid_external_elfutils-557fe9a2dd1d8836b0c2b8e82409f0923731117d.tar.gz
android_external_elfutils-557fe9a2dd1d8836b0c2b8e82409f0923731117d.tar.bz2
android_external_elfutils-557fe9a2dd1d8836b0c2b8e82409f0923731117d.zip
Fix build with GCC 4.7
GCC 4.7 actually digs into try_open() and find variable "fname" isn't initialized in all paths leading to its use at free(fname), but not smart enough to know that the value of fname doesn't matter when fd < 0 Initialize fname at definition before GCC gets smarter. Change-Id: I3bc5b52b3a13e5f4ec49ea0c9627bb0661b11f8a
-rw-r--r--libdwfl/find-debuginfo.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libdwfl/find-debuginfo.c b/libdwfl/find-debuginfo.c
index c58997d1..ccf16aa0 100644
--- a/libdwfl/find-debuginfo.c
+++ b/libdwfl/find-debuginfo.c
@@ -205,7 +205,9 @@ find_debuginfo_in_path (Dwfl_Module *mod, const char *file_name,
break;
}
- char *fname;
+/* ANDROID_CHANGE_BEGIN */
+ char *fname = NULL;
+/* ANDROID_CHANGE_END */
int fd = try_open (dir, subdir, debuglink_file, &fname);
if (fd < 0)
switch (errno)