diff options
author | fenner <fenner@FreeBSD.org> | 2000-07-20 21:26:45 +0000 |
---|---|---|
committer | fenner <fenner@FreeBSD.org> | 2000-07-20 21:26:45 +0000 |
commit | 6f08532b51656817ca97987b95e3b7422d6be2ae (patch) | |
tree | 54156d733195dd8b9ddab8557a198a9124687482 /contrib | |
parent | 1cee9409149f481a600c225bd835b5ae3e27053b (diff) | |
download | FreeBSD-src-6f08532b51656817ca97987b95e3b7422d6be2ae.zip FreeBSD-src-6f08532b51656817ca97987b95e3b7422d6be2ae.tar.gz |
Import rev 1.26 of tcpdump.org's inet.c -- don't free
the buffer before it's used.
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/libpcap/inet.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/contrib/libpcap/inet.c b/contrib/libpcap/inet.c index 33b52c0..feeed42 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); } |