* mi-cmd-var.c (mi_cmd_var_delete): Remove unused variable,
stop memory leak, straighten out cleanups.
2007-08-03 Michael Snyder <msnyder@access-company.com>
+ * mi-cmd-var.c (mi_cmd_var_delete): Remove unused variable,
+ stop memory leak, straighten out cleanups.
+
* jv-lang.c (java_link_class_type): Guard against NULL.
2007-08-02 Michael Snyder <msnyder@access-company.com>
mi_cmd_var_delete (char *command, char **argv, int argc)
{
char *name;
- char *expr;
struct varobj *var;
int numdel;
int children_only_p = 0;
which would be the variable name. */
if (argc == 2)
{
- expr = xstrdup (argv[1]);
if (strcmp (name, "-c") != 0)
error (_("mi_cmd_var_delete: Invalid option."));
children_only_p = 1;
- xfree (name);
- name = xstrdup (expr);
- xfree (expr);
+ do_cleanups (old_cleanups);
+ name = xstrdup (argv[1]);
+ make_cleanup (free_current_contents, &name);
}
/* If we didn't error out, now NAME contains the name of the