aboutsummaryrefslogtreecommitdiff
path: root/gdb/symtab.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2013-01-17 19:55:18 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2013-01-17 19:55:18 +0000
commitc89ffd862078b73a03cb0fedb435f87dd0c03506 (patch)
tree9fccea9aee4565a36999e02e5ca60bc3c43ba55f /gdb/symtab.c
parentaebb1cc98b86fb4941cc461ce7901520a88cd20d (diff)
downloadgdb-c89ffd862078b73a03cb0fedb435f87dd0c03506.zip
gdb-c89ffd862078b73a03cb0fedb435f87dd0c03506.tar.gz
gdb-c89ffd862078b73a03cb0fedb435f87dd0c03506.tar.bz2
gdb/
* symtab.c (iterate_over_some_symtabs): New variable cleanups, initialize it by existing make_cleanup. Call new do_cleanups.
Diffstat (limited to 'gdb/symtab.c')
-rw-r--r--gdb/symtab.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/gdb/symtab.c b/gdb/symtab.c
index f4ed8b9..c304f70 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -241,19 +241,26 @@ iterate_over_some_symtabs (const char *name,
{
const char *fullname = symtab_to_fullname (s);
char *rp = gdb_realpath (fullname);
+ struct cleanup *cleanups = make_cleanup (xfree, rp);
- make_cleanup (xfree, rp);
if (FILENAME_CMP (real_path, rp) == 0)
{
if (callback (s, data))
- return 1;
+ {
+ do_cleanups (cleanups);
+ return 1;
+ }
}
if (!is_abs && compare_filenames_for_search (rp, name))
{
if (callback (s, data))
- return 1;
+ {
+ do_cleanups (cleanups);
+ return 1;
+ }
}
+ do_cleanups (cleanups);
}
}