diff options
author | 2015-12-28 22:08:18 +0000 | |
---|---|---|
committer | 2015-12-28 22:08:18 +0000 | |
commit | b4c66e9d35799de272ab90c8189d8cc311f97053 (patch) | |
tree | 553ba46476200501cc8855419b9aaf42b39d3ef8 /lib/libc/stdio/asprintf.c | |
parent | Build most of games/ with -Werror-implicit-function-declaration. (diff) | |
download | wireguard-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/asprintf.c')
-rw-r--r-- | lib/libc/stdio/asprintf.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/libc/stdio/asprintf.c b/lib/libc/stdio/asprintf.c index bd12726fbf0..48236775908 100644 --- a/lib/libc/stdio/asprintf.c +++ b/lib/libc/stdio/asprintf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: asprintf.c,v 1.21 2015/08/31 02:53:57 guenther Exp $ */ +/* $OpenBSD: asprintf.c,v 1.22 2015/12/28 22:08:18 mmcc Exp $ */ /* * Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com> @@ -52,10 +52,8 @@ asprintf(char **str, const char *fmt, ...) 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); |