summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorcsjp <csjp@FreeBSD.org>2005-09-13 22:13:01 +0000
committercsjp <csjp@FreeBSD.org>2005-09-13 22:13:01 +0000
commit5a87a7f523c3dfdcd3a44b066eaf8016271655e0 (patch)
tree1682ca043fcdaea438b5f7c9c207855ec28a021b /usr.bin
parent6854071b1a929601c7e87fe24a5dadd83ae55e1e (diff)
downloadFreeBSD-src-5a87a7f523c3dfdcd3a44b066eaf8016271655e0.zip
FreeBSD-src-5a87a7f523c3dfdcd3a44b066eaf8016271655e0.tar.gz
If there are'nt any bpf descriptors to process than dont bother attempting to
retrieve statistic information for them. Pointed out by: Pawel Worach < pawel.worach at gmail.com >
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/netstat/bpf.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/usr.bin/netstat/bpf.c b/usr.bin/netstat/bpf.c
index e046ee5..c5d197d 100644
--- a/usr.bin/netstat/bpf.c
+++ b/usr.bin/netstat/bpf.c
@@ -91,6 +91,8 @@ bpf_stats(char *interface)
warn("net.bpf.stats");
return;
}
+ if (size == 0)
+ return;
bd = malloc(size);
if (bd == NULL) {
warn("malloc failed");
OpenPOWER on IntegriCloud