summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio/vasprintf.c
diff options
context:
space:
mode:
authormmcc <mmcc@openbsd.org>2015-12-28 22:08:18 +0000
committermmcc <mmcc@openbsd.org>2015-12-28 22:08:18 +0000
commitb4c66e9d35799de272ab90c8189d8cc311f97053 (patch)
tree553ba46476200501cc8855419b9aaf42b39d3ef8 /lib/libc/stdio/vasprintf.c
parentBuild most of games/ with -Werror-implicit-function-declaration. (diff)
downloadwireguard-openbsd-b4c66e9d35799de272ab90c8189d8cc311f97053.tar.xz
wireguard-openbsd-b4c66e9d35799de272ab90c8189d8cc311f97053.zip
Remove NULL-checks before free() and a few related dead assignments.
ok and valuable input from millert@
Diffstat (limited to 'lib/libc/stdio/vasprintf.c')
-rw-r--r--lib/libc/stdio/vasprintf.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/libc/stdio/vasprintf.c b/lib/libc/stdio/vasprintf.c
index 11d90a4b187..98cdb45549f 100644
--- a/lib/libc/stdio/vasprintf.c
+++ b/lib/libc/stdio/vasprintf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vasprintf.c,v 1.18 2015/08/31 02:53:57 guenther Exp $ */
+/* $OpenBSD: vasprintf.c,v 1.19 2015/12/28 22:08:18 mmcc Exp $ */
/*
* Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -48,10 +48,8 @@ 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);
+ f._bf._base = NULL;
*str = NULL;
errno = ENOMEM;
return (-1);