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.
This commit is contained in:
Tom Tromey 2013-05-30 17:01:16 +00:00
parent e61727abf0
commit 48be7c1b92
2 changed files with 6 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2013-05-30 Tom Tromey <tromey@redhat.com>
* utils.c (internal_vproblem): Call do_cleanups.
2013-05-30 Tom Tromey <tromey@redhat.com>
* linespec.c (find_linespec_symbols): Don't reassign to 'cleanup'.

View File

@ -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 = {