]> The Tcpdump Group git mirrors - libpcap/commitdiff
Fixed a leak in pcap_open_live (win32): the pcap_t handle was not freed
authorrisso <risso>
Fri, 10 Jun 2005 03:48:56 +0000 (03:48 +0000)
committerrisso <risso>
Fri, 10 Jun 2005 03:48:56 +0000 (03:48 +0000)
if PacketOpenAdapter fails.

pcap-win32.c

index ddc57fcc758128e42286ca5038094dde6f9c65b4..a0778c43cb8dc62cefcdfec96a96da3a6ba9408f 100644 (file)
@@ -32,7 +32,7 @@
 
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/libpcap/pcap-win32.c,v 1.25.2.1 2005-05-03 18:54:38 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/libpcap/pcap-win32.c,v 1.25.2.2 2005-06-10 03:48:56 risso Exp $ (LBL)";
 #endif
 
 #include <pcap-int.h>
@@ -411,6 +411,7 @@ pcap_open_live(const char *device, int snaplen, int promisc, int to_ms,
        
        if (p->adapter == NULL)
        {
+               free(p);
                /* Adapter detected but we are not able to open it. Return failure. */
                snprintf(ebuf, PCAP_ERRBUF_SIZE, "Error opening adapter: %s", pcap_win32strerror());
                return NULL;