diff options
author | Tom Tromey <tromey@redhat.com> | 2013-05-30 17:21:15 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2013-05-30 17:21:15 +0000 |
commit | a991ac289d2074310c8746ada6df5f67bdd27222 (patch) | |
tree | 78bfebdfd4d5cd180422c49d5b5292a509c5691a /gdb | |
parent | 1abaf0423f9c1391c193baa0f54445a1b5367ab6 (diff) | |
download | gdb-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')
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/symfile.c | 10 |
2 files changed, 13 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 5331d5b..e3e8aa2 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2013-05-30 Tom Tromey <tromey@redhat.com> + * symfile.c (find_separate_debug_file): Call do_cleanups + along all return paths. + +2013-05-30 Tom Tromey <tromey@redhat.com> + * symtab.c (search_symbols): Introduce a null cleanup for 'retval_chain'. 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; + } } } |