summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-05-30 17:04:47 +0000
committerTom Tromey <tromey@redhat.com>2013-05-30 17:04:47 +0000
commitb888adba161204724ff72d0c18f78c63e9322a95 (patch)
tree9a1231ea3545734155b822eb0e2316afc19521f3
parentfe3883c5a86d66f9c29239b71226fae0f358ba08 (diff)
downloadgdb-b888adba161204724ff72d0c18f78c63e9322a95.tar.gz
fix list_available_thread_groups
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.
-rw-r--r--gdb/ChangeLog4
-rw-r--r--gdb/mi/mi-main.c5
2 files changed, 8 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index c3303ea78dd..53a3eb711ab 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
2013-05-30 Tom Tromey <tromey@redhat.com>
+ * mi/mi-main.c (list_available_thread_groups): Call do_cleanups.
+
+2013-05-30 Tom Tromey <tromey@redhat.com>
+
* inf-ptrace.c (inf_ptrace_create_inferior): Unconditionally
call discard_cleanups.
(inf_ptrace_attach): Likewise.
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
index 9428e8c8df4..f69cd8d62d7 100644
--- a/gdb/mi/mi-main.c
+++ b/gdb/mi/mi-main.c
@@ -681,6 +681,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.
@@ -690,7 +691,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)
{
@@ -793,6 +794,8 @@ list_available_thread_groups (VEC (int) *ids, int recurse)
do_cleanups (back_to);
}
+
+ do_cleanups (cleanup);
}
void