aboutsummaryrefslogtreecommitdiff
path: root/gdb/symfile.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-05-30 17:21:15 +0000
committerTom Tromey <tromey@redhat.com>2013-05-30 17:21:15 +0000
commita991ac289d2074310c8746ada6df5f67bdd27222 (patch)
tree78bfebdfd4d5cd180422c49d5b5292a509c5691a /gdb/symfile.c
parent1abaf0423f9c1391c193baa0f54445a1b5367ab6 (diff)
downloadgdb-a991ac289d2074310c8746ada6df5f67bdd27222.zip
gdb-a991ac289d2074310c8746ada6df5f67bdd27222.tar.gz
gdb-a991ac289d2074310c8746ada6df5f67bdd27222.tar.bz2
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 360f999..c2ad797 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;
+ }
}
}