Commit 407868de authored by Masahiro Yamada's avatar Masahiro Yamada

kconfig: remove redundant NULL pointer check before free()

Passing NULL to free() is allowed and is a no-op.

Remove redundant NULL pointer checks.
Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
parent 9ad86d74
......@@ -432,7 +432,6 @@ int conf_read_simple(const char *name, int def)
case S_INT:
case S_HEX:
case S_STRING:
if (sym->def[def].val)
free(sym->def[def].val);
/* fall through */
default:
......
......@@ -42,7 +42,6 @@ struct gstr str_new(void)
/* Free storage for growable string */
void str_free(struct gstr *gs)
{
if (gs->s)
free(gs->s);
gs->s = NULL;
gs->len = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment