From: Tom Tromey Date: Thu, 30 May 2013 17:21:15 +0000 (+0000) Subject: fix one bug in symfile.c X-Git-Tag: cygwin-1_7_19-release~30 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a991ac289d2074310c8746ada6df5f67bdd27222;p=external%2Fbinutils.git 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. --- 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 + * symfile.c (find_separate_debug_file): Call do_cleanups + along all return paths. + +2013-05-30 Tom Tromey + * 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; + } } }