+Tue May 16 14:17:20 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * utils.c (free_current_contents): Make more robust.
+
Tue May 16 13:30:08 2000 Andrew Cagney <cagney@b1.cygnus.com>
* symtab.h (make_cleanup_discard_minimal_symbols): Replace
+Tue May 16 14:13:41 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-main.c (mi_cmd_execute): Use free_current_contents.
+ (free_and_reset): Delete.
+
Mon May 15 16:17:56 2000 Andrew Cagney <cagney@b1.cygnus.com>
* mi-main.c (mi_cmd_data_assign, mi_cmd_data_evaluate_expression),
static void mi_execute_command_wrapper (char *cmd);
void mi_exec_async_cli_cmd_continuation (struct continuation_arg *arg);
-static void free_and_reset (char **arg);
static int register_changed_p (int regnum);
static int get_register (int regnum, int format);
}
}
last_async_command = xstrdup (parse->token);
- make_exec_cleanup ((make_cleanup_func) free_and_reset, &last_async_command);
+ make_exec_cleanup (free_current_contents, &last_async_command);
/* FIXME: DELETE THIS! */
if (parse->cmd->args_func != NULL)
return parse->cmd->args_func (parse->args, 0 /*from_tty */ );
}
}
-void
-free_and_reset (char **arg)
-{
- free (*arg);
- *arg = NULL;
-}
-
static void
mi_execute_command_wrapper (char *cmd)
{
free_current_contents (void *ptr)
{
void **location = ptr;
+ if (location == NULL)
+ internal_error ("free_current_contents: NULL pointer");
if (*location != NULL)
- free (*location);
+ {
+ free (*location);
+ *location = NULL;
+ }
}
/* Provide a known function that does nothing, to use as a base for