stdio: simplify vasprintf()
... by removing unneeded NULL check, as free() already does it. By the way, we don't need to set a stack variable back to NULL. Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com> Change-Id: Id90eb8f042b5c922c5ff139b11ff8366fb404566
This commit is contained in:
parent
6aed4288eb
commit
c8a850bcd1
1 changed files with 1 additions and 4 deletions
|
@ -48,10 +48,7 @@ vasprintf(char **str, const char *fmt, __va_list ap)
|
|||
return (ret);
|
||||
|
||||
err:
|
||||
if (f._bf._base) {
|
||||
free(f._bf._base);
|
||||
f._bf._base = NULL;
|
||||
}
|
||||
free(f._bf._base);
|
||||
*str = NULL;
|
||||
errno = ENOMEM;
|
||||
return (-1);
|
||||
|
|
Loading…
Reference in a new issue