summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsg <jsg@openbsd.org>2015-04-18 09:32:59 +0000
committerjsg <jsg@openbsd.org>2015-04-18 09:32:59 +0000
commit28a437da50d2b13345eab4b36c7305b94ec4e008 (patch)
tree2fba536236625711ca0239db46b1d228671f2e2b
parentRegis Leroy reported that httpd does not strictly accept CRLF for (diff)
downloadwireguard-openbsd-28a437da50d2b13345eab4b36c7305b94ec4e008.tar.xz
wireguard-openbsd-28a437da50d2b13345eab4b36c7305b94ec4e008.zip
Avoid calling freeifaddrs() with an uninitialised pointer in an
error path.
-rw-r--r--usr.bin/systat/mbufs.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/systat/mbufs.c b/usr.bin/systat/mbufs.c
index 723cac82552..e58889c7ae5 100644
--- a/usr.bin/systat/mbufs.c
+++ b/usr.bin/systat/mbufs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mbufs.c,v 1.39 2015/01/20 18:26:57 deraadt Exp $ */
+/* $OpenBSD: mbufs.c,v 1.40 2015/04/18 09:32:59 jsg Exp $ */
/*
* Copyright (c) 2008 Can Erkin Acar <canacar@openbsd.org>
*
@@ -204,7 +204,7 @@ int
read_mb(void)
{
struct kinfo_pool pool;
- struct ifaddrs *ifap, *ifa;
+ struct ifaddrs *ifap = NULL, *ifa;
struct if_info *ifi;
struct if_rxring_info *ifr;
int mib[4];
@@ -344,7 +344,8 @@ read_mb(void)
}
exit:
- freeifaddrs(ifap);
+ if (ifap)
+ freeifaddrs(ifap);
return (ret);
}