diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-11-21 22:42:56 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-11-21 22:42:56 +0000 |
commit | 3117067c9ac99c884e086f5482182a878f81d8d7 (patch) | |
tree | 02303b6bba8b7500b9bdf2433b72f5a7da3c44a0 /usr.sbin/arp/arp.c | |
parent | 4e27eacce0dd0d7fc0af65afc7cc8cc4a8f6f29b (diff) |
bail if no arp entries
Diffstat (limited to 'usr.sbin/arp/arp.c')
-rw-r--r-- | usr.sbin/arp/arp.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/arp/arp.c b/usr.sbin/arp/arp.c index c60e91739ff..1955b600586 100644 --- a/usr.sbin/arp/arp.c +++ b/usr.sbin/arp/arp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: arp.c,v 1.8 1997/09/12 04:07:16 millert Exp $ */ +/* $OpenBSD: arp.c,v 1.9 1997/11/21 22:42:55 deraadt Exp $ */ /* $NetBSD: arp.c,v 1.12 1995/04/24 13:25:18 cgd Exp $ */ /* @@ -373,6 +373,8 @@ dump(addr) mib[5] = RTF_LLINFO; if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0) err(1, "route-sysctl-estimate"); + if (needed == 0) + return; if ((buf = malloc(needed)) == NULL) err(1, "malloc"); if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0) |