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.
This commit is contained in:
Tom Tromey 2013-05-30 17:21:15 +00:00
parent 1abaf0423f
commit a991ac289d
2 changed files with 13 additions and 2 deletions

View File

@ -1,3 +1,8 @@
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

View File

@ -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;
}
}
}