From 15f3d81f9c896dcbd75b9f638807a6050b5f74bc Mon Sep 17 00:00:00 2001 From: "Christian S.J. Peron" Date: Tue, 13 Sep 2005 22:13:01 +0000 Subject: [PATCH] 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 > --- usr.bin/netstat/bpf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/usr.bin/netstat/bpf.c b/usr.bin/netstat/bpf.c index e046ee57a35e..c5d197dddd18 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");