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

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
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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:
+1 −2
Original line number Diff line number Diff line
@@ -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;