]> The Tcpdump Group git mirrors - libpcap/commitdiff
Free the memory allocated for the Wireless Extensions private ioctl list
authorguy <guy>
Mon, 7 Apr 2008 00:31:47 +0000 (00:31 +0000)
committerguy <guy>
Mon, 7 Apr 2008 00:31:47 +0000 (00:31 +0000)
before returning.

pcap-linux.c

index 712937733fe988195bb0e48f2c479b3ad681aa78..43e3a388a9ca455f359d819b5faed8144f133e99 100644 (file)
@@ -34,7 +34,7 @@
 
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/libpcap/pcap-linux.c,v 1.141 2008-04-04 20:51:43 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/libpcap/pcap-linux.c,v 1.142 2008-04-07 00:31:47 guy Exp $ (LBL)";
 #endif
 
 /*
@@ -2329,6 +2329,7 @@ enter_rfmon_mode_wext(pcap_t *handle, int sock_fd, const char *device)
        if (ioctl(sock_fd, SIOCGIWPRIV, &ireq) == -1) {
                snprintf(handle->errbuf, PCAP_ERRBUF_SIZE,
                    "%s: SIOCGIWPRIV: %s", device, pcap_strerror(errno));
+               free(priv);
                return PCAP_ERROR;
        }
 
@@ -2481,6 +2482,7 @@ enter_rfmon_mode_wext(pcap_t *handle, int sock_fd, const char *device)
                        }
                }
        }
+       free(priv);
 
        /*
         * XXX - ipw3945?  islism?