summaryrefslogtreecommitdiff
path: root/gdb/symfile.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-05-30 17:21:14 +0000
committerTom Tromey <tromey@redhat.com>2013-05-30 17:21:14 +0000
commit071bf1d63dae39f38e3c59208d436c71ec22e534 (patch)
tree9d384d855cbf9fa7b303477001ff96c5891de328 /gdb/symfile.c
parentfa5ef4de3adb10fbe3bfb7e758434b315fad9fea (diff)
downloadgdb-071bf1d63dae39f38e3c59208d436c71ec22e534.tar.gz
fix one bug in symfile.c
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.
Diffstat (limited to 'gdb/symfile.c')
-rw-r--r--gdb/symfile.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gdb/symfile.c b/gdb/symfile.c
index 360f9993ec6..c2ad7975091 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -1428,7 +1428,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. */
@@ -1443,7 +1446,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;
+ }
}
}