From: Tom Tromey Date: Thu, 30 May 2013 17:01:16 +0000 (+0000) Subject: fix up cleanup handling in internal_vproblem X-Git-Tag: cygwin-1_7_19-release~45 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=48be7c1b927d5f7a8a73aef6cf840284b272dde4;p=thirdparty%2Fbinutils-gdb.git fix up cleanup handling in internal_vproblem internal_vproblem can return, so this introduces proper cleanup handling there. Otherwise it may make a cleanup that is leaked. * utils.c (internal_vproblem): Call do_cleanups. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 4f323851a17..4005a63decf 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2013-05-30 Tom Tromey + + * utils.c (internal_vproblem): Call do_cleanups. + 2013-05-30 Tom Tromey * linespec.c (find_linespec_symbols): Don't reassign to 'cleanup'. diff --git a/gdb/utils.c b/gdb/utils.c index 218faed0bab..c25dadfe286 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -713,6 +713,7 @@ internal_vproblem (struct internal_problem *problem, int quit_p; int dump_core_p; char *reason; + struct cleanup *cleanup = make_cleanup (null_cleanup, NULL); /* Don't allow infinite error/warning recursion. */ { @@ -821,6 +822,7 @@ internal_vproblem (struct internal_problem *problem, } dejavu = 0; + do_cleanups (cleanup); } static struct internal_problem internal_error_problem = {