[PATCH 22/40] fix symtab.c

Tom Tromey
2013-05-09T18:51:51Z

search_symbols had some bad code resulting in a cleanup being both
discarded and run.

* symtab.c (search_symbols): Introduce a null cleanup for
'retval_chain'.
---
gdb/symtab.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/symtab.c b/gdb/symtab.c
index def556b..9040035 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -3529,7 +3529,7 @@ search_symbols (char *regexp, enum search_domain kind,
&datum);
}

- retval_chain = old_chain;
+ retval_chain = make_cleanup (null_cleanup, NULL);

/* Here, we search through the minimal symbol tables for functions
and variables that match, and force their symbols to be read.
--
1.8.1.4