This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 08/40] fix up cleanup handling in internal_vproblem
- From: Tom Tromey <tromey at redhat dot com>
- From: Tom Tromey <tromey at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Thu, 09 May 2013 12:50:53 -0600
- Subject: [PATCH 08/40] fix up cleanup handling in internal_vproblem
- References: <cover dot 1368124285 dot git dot tromey at redhat dot com>
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.
---
gdb/utils.c | 2 ++
1 file changed, 2 insertions(+)
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 = {
--
1.8.1.4