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>
This commit is contained in:
Maninder Singh
2015-06-01 10:38:07 +00:00
committed by Denys Vlasenko
parent d90899206d
commit 0fabedf085
4 changed files with 7 additions and 14 deletions

View File

@ -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;
}