gdb/
* cli/cli-setshow.c (do_setshow_command): Don't check pointer is NULL for xfree.
This commit is contained in:
parent
a8f301aa99
commit
c24343e289
2 changed files with 8 additions and 6 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2012-07-20 Yao Qi <yao@codesourcery.com>
|
||||||
|
|
||||||
|
* cli/cli-setshow.c (do_setshow_command): Don't check pointer is
|
||||||
|
NULL for xfree.
|
||||||
|
|
||||||
2012-07-19 Pedro Alves <palves@redhat.com>
|
2012-07-19 Pedro Alves <palves@redhat.com>
|
||||||
|
|
||||||
* record.c (record_resume): Ask the target beneath to report all
|
* record.c (record_resume): Ask the target beneath to report all
|
||||||
|
|
|
@ -170,16 +170,14 @@ do_setshow_command (char *arg, int from_tty, struct cmd_list_element *c)
|
||||||
#endif
|
#endif
|
||||||
*q++ = '\0';
|
*q++ = '\0';
|
||||||
new = (char *) xrealloc (new, q - new);
|
new = (char *) xrealloc (new, q - new);
|
||||||
if (*(char **) c->var != NULL)
|
xfree (*(char **) c->var);
|
||||||
xfree (*(char **) c->var);
|
|
||||||
*(char **) c->var = new;
|
*(char **) c->var = new;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case var_string_noescape:
|
case var_string_noescape:
|
||||||
if (arg == NULL)
|
if (arg == NULL)
|
||||||
arg = "";
|
arg = "";
|
||||||
if (*(char **) c->var != NULL)
|
xfree (*(char **) c->var);
|
||||||
xfree (*(char **) c->var);
|
|
||||||
*(char **) c->var = xstrdup (arg);
|
*(char **) c->var = xstrdup (arg);
|
||||||
break;
|
break;
|
||||||
case var_filename:
|
case var_filename:
|
||||||
|
@ -187,8 +185,7 @@ do_setshow_command (char *arg, int from_tty, struct cmd_list_element *c)
|
||||||
error_no_arg (_("filename to set it to."));
|
error_no_arg (_("filename to set it to."));
|
||||||
/* FALLTHROUGH */
|
/* FALLTHROUGH */
|
||||||
case var_optional_filename:
|
case var_optional_filename:
|
||||||
if (*(char **) c->var != NULL)
|
xfree (*(char **) c->var);
|
||||||
xfree (*(char **) c->var);
|
|
||||||
|
|
||||||
if (arg != NULL)
|
if (arg != NULL)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue