diff options
author | Nick Roberts <nickrob@snap.net.nz> | 2006-12-08 04:09:53 +0000 |
---|---|---|
committer | Nick Roberts <nickrob@snap.net.nz> | 2006-12-08 04:09:53 +0000 |
commit | db9a518b07b656e17230459a945301822ea13404 (patch) | |
tree | df711565518eafd3ec14051c5ffb496bf8aaa8ac /gdb/mi | |
parent | ba17f7aa4d2cb05fd1accd9fe6163d23e3b8725e (diff) | |
download | gdb-db9a518b07b656e17230459a945301822ea13404.zip gdb-db9a518b07b656e17230459a945301822ea13404.tar.gz gdb-db9a518b07b656e17230459a945301822ea13404.tar.bz2 |
(mi_cmd_var_update): Fix memory leak.
Diffstat (limited to 'gdb/mi')
-rw-r--r-- | gdb/mi/mi-cmd-var.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gdb/mi/mi-cmd-var.c b/gdb/mi/mi-cmd-var.c index 0b131d9..8bd8a63 100644 --- a/gdb/mi/mi-cmd-var.c +++ b/gdb/mi/mi-cmd-var.c @@ -500,10 +500,11 @@ mi_cmd_var_update (char *command, char **argv, int argc) if ((*name == '*') && (*(name + 1) == '\0')) { nv = varobj_list (&rootlist); + cleanup = make_cleanup (xfree, rootlist); if (mi_version (uiout) <= 1) - cleanup = make_cleanup_ui_out_tuple_begin_end (uiout, "changelist"); + make_cleanup_ui_out_tuple_begin_end (uiout, "changelist"); else - cleanup = make_cleanup_ui_out_list_begin_end (uiout, "changelist"); + make_cleanup_ui_out_list_begin_end (uiout, "changelist"); if (nv <= 0) { do_cleanups (cleanup); @@ -515,7 +516,6 @@ mi_cmd_var_update (char *command, char **argv, int argc) varobj_update_one (*cr, print_values); cr++; } - xfree (rootlist); do_cleanups (cleanup); } else |