Skip to content

Commit

Permalink
added the freeing of pcap_binding
Browse files Browse the repository at this point in the history
  • Loading branch information
harrydevnull committed Jul 9, 2016
1 parent 829f964 commit fefafbb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pcap_binding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,15 @@ class PcapWorker : public AsyncWorker {

pcap_loop(pcap_handle, num_packets, OnPacketReady, (unsigned char *)pcap_dump_handle);
pcap_freecode(&fp);
/*
* Close the savefile opened in pcap_dump_open().
*/
pcap_dump_close(pcap_dump_handle);
/*
* Close the packet capture device and free the memory used by the
* packet capture descriptor.
*/
pcap_close(pcap_handle);
}
}

Expand Down

0 comments on commit fefafbb

Please sign in to comment.