2007-08-10 Michael Snyder <msnyder@access-company.com>
authorMichael Snyder <msnyder@vmware.com>
Fri, 10 Aug 2007 21:44:23 +0000 (21:44 +0000)
committerMichael Snyder <msnyder@vmware.com>
Fri, 10 Aug 2007 21:44:23 +0000 (21:44 +0000)
* mi/mi-cmd-var.c (mi_cmd_var_list_children): Memory leak.

gdb/ChangeLog
gdb/mi/mi-cmd-var.c

index 2057dcc3ed2293cce037d6173cd7effb613e22db..4d854ee2f879d76be0ea1cd8ecf8c41ee4238d04 100644 (file)
@@ -1,5 +1,7 @@
 2007-08-10  Michael Snyder  <msnyder@access-company.com>
 
+       * mi/mi-cmd-var.c (mi_cmd_var_list_children): Memory leak.
+
        * solib-svr4.c (enable_break): Don't free tmp_pathname until
        after closing bfd.
 
index 12d69adbea80427b011a4442c36499ee8b427b89..37c87ff1da3ffa859896dfdd7c5c44b1ea229a3d 100644 (file)
@@ -373,7 +373,10 @@ mi_cmd_var_list_children (char *command, char **argv, int argc)
     print_values = PRINT_NO_VALUES;
 
   if (numchild <= 0)
-    return MI_CMD_DONE;
+    {
+      xfree (childlist);
+      return MI_CMD_DONE;
+    }
 
   if (mi_version (uiout) == 1)
     cleanup_children = make_cleanup_ui_out_tuple_begin_end (uiout, "children");