diff options
author | Yao Qi <yao@codesourcery.com> | 2012-07-20 08:59:32 +0000 |
---|---|---|
committer | Yao Qi <yao@codesourcery.com> | 2012-07-20 08:59:32 +0000 |
commit | c24343e28935f4ae36989a8e3f13b4f9cde23d3c (patch) | |
tree | aa85945d9ee1a5badf27c0f49a3a6c7ba382d957 /gdb/cli/cli-setshow.c | |
parent | a8f301aa99d81e826045112f65ec6c53746e4676 (diff) | |
download | gdb-c24343e28935f4ae36989a8e3f13b4f9cde23d3c.zip gdb-c24343e28935f4ae36989a8e3f13b4f9cde23d3c.tar.gz gdb-c24343e28935f4ae36989a8e3f13b4f9cde23d3c.tar.bz2 |
gdb/
* cli/cli-setshow.c (do_setshow_command): Don't check pointer is
NULL for xfree.
Diffstat (limited to 'gdb/cli/cli-setshow.c')
-rw-r--r-- | gdb/cli/cli-setshow.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/gdb/cli/cli-setshow.c b/gdb/cli/cli-setshow.c index dccf425..5ec7b55 100644 --- a/gdb/cli/cli-setshow.c +++ b/gdb/cli/cli-setshow.c @@ -170,16 +170,14 @@ do_setshow_command (char *arg, int from_tty, struct cmd_list_element *c) #endif *q++ = '\0'; new = (char *) xrealloc (new, q - new); - if (*(char **) c->var != NULL) - xfree (*(char **) c->var); + xfree (*(char **) c->var); *(char **) c->var = new; } break; case var_string_noescape: if (arg == NULL) arg = ""; - if (*(char **) c->var != NULL) - xfree (*(char **) c->var); + xfree (*(char **) c->var); *(char **) c->var = xstrdup (arg); break; 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.")); /* FALLTHROUGH */ case var_optional_filename: - if (*(char **) c->var != NULL) - xfree (*(char **) c->var); + xfree (*(char **) c->var); if (arg != NULL) { |