This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 11/40] fix list_available_thread_groups
- 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:51:05 -0600
- Subject: [PATCH 11/40] fix list_available_thread_groups
- References: <cover dot 1368124285 dot git dot tromey at redhat dot com>
list_available_thread_groups, in mi-main.c, leaks a cleanup.
This changes it to call do_cleanups.
* mi/mi-main.c (list_available_thread_groups): Call do_cleanups.
---
gdb/mi/mi-main.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
index 94fda8f..f11b769 100644
--- a/gdb/mi/mi-main.c
+++ b/gdb/mi/mi-main.c
@@ -678,6 +678,7 @@ list_available_thread_groups (VEC (int) *ids, int recurse)
struct osdata_item *item;
int ix_items;
struct ui_out *uiout = current_uiout;
+ struct cleanup *cleanup;
/* This keeps a map from integer (pid) to VEC (struct osdata_item *)*
The vector contains information about all threads for the given pid.
@@ -687,7 +688,7 @@ list_available_thread_groups (VEC (int) *ids, int recurse)
/* get_osdata will throw if it cannot return data. */
data = get_osdata ("processes");
- make_cleanup_osdata_free (data);
+ cleanup = make_cleanup_osdata_free (data);
if (recurse)
{
@@ -790,6 +791,8 @@ list_available_thread_groups (VEC (int) *ids, int recurse)
do_cleanups (back_to);
}
+
+ do_cleanups (cleanup);
}
void
--
1.8.1.4