From: risso Date: Fri, 10 Jun 2005 03:49:19 +0000 (+0000) Subject: Fixed a leak in pcap_open_live (win32): the pcap_t handle was not freed X-Git-Tag: libpcap-1.1.0~610 X-Git-Url: https://git.tcpdump.org/libpcap/commitdiff_plain/5636631e5880f0c47bebf5d32406165496e666fd Fixed a leak in pcap_open_live (win32): the pcap_t handle was not freed if PacketOpenAdapter fails. --- diff --git a/pcap-win32.c b/pcap-win32.c index f2bab606..434ab771 100644 --- a/pcap-win32.c +++ b/pcap-win32.c @@ -32,7 +32,7 @@ #ifndef lint static const char rcsid[] _U_ = - "@(#) $Header: /tcpdump/master/libpcap/pcap-win32.c,v 1.26 2005-05-03 18:54:01 guy Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/libpcap/pcap-win32.c,v 1.27 2005-06-10 03:49:19 risso Exp $ (LBL)"; #endif #include @@ -419,6 +419,7 @@ pcap_open_live(const char *device, int snaplen, int promisc, int to_ms, /*get network type*/ if(PacketGetNetType (p->adapter,&type) == FALSE) { + free(p); snprintf(ebuf, PCAP_ERRBUF_SIZE, "Cannot determine the network type: %s", pcap_win32strerror()); goto bad; }