diff options
author | Maninder Singh | 2015-06-01 10:38:07 +0000 |
---|---|---|
committer | Denys Vlasenko | 2015-06-07 18:19:43 +0200 |
commit | 0fabedf085591b50994e4f8c133bfa87f1777ee4 (patch) | |
tree | 8308679426e463e68eb9f61cf5883c03c437c79d /scripts | |
parent | d90899206dd96b4c18064c18afc3b856382e64d4 (diff) | |
download | busybox-0fabedf085591b50994e4f8c133bfa87f1777ee4.zip busybox-0fabedf085591b50994e4f8c133bfa87f1777ee4.tar.gz |
fix if(p)/free(p) construct
No need of explicit NULL check before free.
Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
Signed-off-by: Akhilesh Kumar <akhilesh.k@samsung.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/kconfig/confdata.c | 3 | ||||
-rw-r--r-- | scripts/kconfig/util.c | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index 303df0b..8f4ecbd 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c @@ -124,8 +124,7 @@ int conf_read_simple(const char *name) case S_INT: case S_HEX: case S_STRING: - if (sym->user.val) - free(sym->user.val); + free(sym->user.val); default: sym->user.val = NULL; sym->user.tri = no; diff --git a/scripts/kconfig/util.c b/scripts/kconfig/util.c index 2630919..13369e6 100644 --- a/scripts/kconfig/util.c +++ b/scripts/kconfig/util.c @@ -79,8 +79,7 @@ struct gstr str_assign(const char *s) /* Free storage for growable string */ void str_free(struct gstr *gs) { - if (gs->s) - free(gs->s); + free(gs->s); gs->s = NULL; gs->len = 0; } |