summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio/vfprintf.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/vfprintf.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/vfprintf.c')
-rw-r--r--lib/libc/stdio/vfprintf.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/libc/stdio/vfprintf.c b/lib/libc/stdio/vfprintf.c
index 1e55ad7f494..aa971796342 100644
--- a/lib/libc/stdio/vfprintf.c
+++ b/lib/libc/stdio/vfprintf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfprintf.c,v 1.69 2015/09/29 03:19:24 guenther Exp $ */
+/* $OpenBSD: vfprintf.c,v 1.70 2015/12/28 22:08:18 mmcc Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
@@ -846,10 +846,8 @@ fp_common:
if (flags & LONGINT) {
wchar_t *wcp;
- if (convbuf != NULL) {
- free(convbuf);
- convbuf = NULL;
- }
+ free(convbuf);
+ convbuf = NULL;
if ((wcp = GETARG(wchar_t *)) == NULL) {
cp = "(null)";
} else {
@@ -1075,8 +1073,7 @@ overflow:
finish:
#ifdef PRINTF_WIDE_CHAR
- if (convbuf)
- free(convbuf);
+ free(convbuf);
#endif
#ifdef FLOATING_POINT
if (dtoaresult)