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:
André Goddard Rosa 2010-01-30 22:40:45 -02:00 committed by Jean-Baptiste Queru
parent 6aed4288eb
commit c8a850bcd1

View file

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