aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-05-30 17:01:16 +0000
committerTom Tromey <tromey@redhat.com>2013-05-30 17:01:16 +0000
commit48be7c1b927d5f7a8a73aef6cf840284b272dde4 (patch)
tree8ec5fb75c33a35fb3b462298956e923e75841468
parente61727abf0dca6c26548e1df9d51a370faf28542 (diff)
downloadgdb-48be7c1b927d5f7a8a73aef6cf840284b272dde4.zip
gdb-48be7c1b927d5f7a8a73aef6cf840284b272dde4.tar.gz
gdb-48be7c1b927d5f7a8a73aef6cf840284b272dde4.tar.bz2
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.
-rw-r--r--gdb/ChangeLog4
-rw-r--r--gdb/utils.c2
2 files changed, 6 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 4f32385..4005a63 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
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'.
2013-05-30 Tom Tromey <tromey@redhat.com>
diff --git a/gdb/utils.c b/gdb/utils.c
index 218faed..c25dadf 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 = {