Call pcap_freecode on filter
This commit is contained in:
parent
8dc5b3164b
commit
612741ae36
1 changed files with 4 additions and 1 deletions
|
@ -319,7 +319,10 @@ struct ethsock *ethsock_create(const char *intf, uint16_t protocol)
|
|||
goto cleanup_pcap;
|
||||
}
|
||||
|
||||
if ((err = pcap_setfilter(sock->pcap, &fp))) {
|
||||
err = pcap_setfilter(sock->pcap, &fp);
|
||||
pcap_freecode(&fp);
|
||||
|
||||
if (err) {
|
||||
pcap_perror(sock->pcap, "pcap_setfilter");
|
||||
goto cleanup_pcap;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue