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
diff --git a/libdwfl/find-debuginfo.c b/libdwfl/find-debuginfo.c
index c58997d..ccf16aa 100644
--- a/libdwfl/find-debuginfo.c
+++ b/libdwfl/find-debuginfo.c
@@ -205,7 +205,9 @@
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)