Skip to content

Commit fefafbb

Browse files
committed
added the freeing of pcap_binding
1 parent 829f964 commit fefafbb

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pcap_binding.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,15 @@ class PcapWorker : public AsyncWorker {
108108

109109
pcap_loop(pcap_handle, num_packets, OnPacketReady, (unsigned char *)pcap_dump_handle);
110110
pcap_freecode(&fp);
111+
/*
112+
* Close the savefile opened in pcap_dump_open().
113+
*/
114+
pcap_dump_close(pcap_dump_handle);
115+
/*
116+
* Close the packet capture device and free the memory used by the
117+
* packet capture descriptor.
118+
*/
119+
pcap_close(pcap_handle);
111120
}
112121
}
113122

0 commit comments

Comments
 (0)