This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 23/40] fix one bug in symfile.c
- From: Tom Tromey <tromey at redhat dot com>
- From: Tom Tromey <tromey at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Thu, 09 May 2013 12:51:50 -0600
- Subject: [PATCH 23/40] fix one bug in symfile.c
- References: <cover dot 1368124285 dot git dot tromey at redhat dot com>
find_separate_debug_file could leak a cleanup along some return paths.
* symfile.c (find_separate_debug_file): Call do_cleanups
along all return paths.
---
gdb/symfile.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/gdb/symfile.c b/gdb/symfile.c
index f93d857..7781dfa 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -1469,7 +1469,10 @@ find_separate_debug_file (const char *dir,
strcat (debugfile, debuglink);
if (separate_debug_file_exists (debugfile, crc32, objfile))
- return debugfile;
+ {
+ do_cleanups (back_to);
+ return debugfile;
+ }
/* If the file is in the sysroot, try using its base path in the
global debugfile directory. */
@@ -1484,7 +1487,10 @@ find_separate_debug_file (const char *dir,
strcat (debugfile, debuglink);
if (separate_debug_file_exists (debugfile, crc32, objfile))
- return debugfile;
+ {
+ do_cleanups (back_to);
+ return debugfile;
+ }
}
}
--
1.8.1.4