aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Fenner <fenner@FreeBSD.org>2000-07-20 21:26:45 +0000
committerBill Fenner <fenner@FreeBSD.org>2000-07-20 21:26:45 +0000
commitbb63323352843752e4b60d23b77de85ce3bc4a6e (patch)
tree0f74fb92bbaafb34d827c749f9b0c8f90332f302
parent5a929640374d7dbe9d197ffece1bc89ea7859da6 (diff)
downloadsrc-bb63323352843752e4b60d23b77de85ce3bc4a6e.tar.gz
src-bb63323352843752e4b60d23b77de85ce3bc4a6e.zip
Import rev 1.26 of tcpdump.org's inet.c -- don't free
the buffer before it's used.
Notes
Notes: svn path=/vendor/libpcap/dist/; revision=63696
-rw-r--r--contrib/libpcap/inet.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/contrib/libpcap/inet.c b/contrib/libpcap/inet.c
index 33b52c05b623..feeed428fc82 100644
--- a/contrib/libpcap/inet.c
+++ b/contrib/libpcap/inet.c
@@ -33,7 +33,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/libpcap/inet.c,v 1.24.2.1 2000/01/14 18:00:50 mcr Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/libpcap/inet.c,v 1.26 2000/01/14 23:55:31 mcr Exp $ (LBL)";
#endif
#include <sys/param.h>
@@ -173,15 +173,16 @@ pcap_lookupdev(errbuf)
mp = ifrp;
}
}
- free(buf);
(void)close(fd);
if (mp == NULL) {
(void)strcpy(errbuf, "no suitable device found");
+ free(buf);
return (NULL);
}
(void)strncpy(device, mp->ifr_name, sizeof(device) - 1);
device[sizeof(device) - 1] = '\0';
+ free(buf);
return (device);
}