From: Alan T. DeKok Date: Fri, 3 Feb 2023 13:11:10 +0000 (-0500) Subject: free the filter on error path. Fixes #4881 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7955e9618e864cf36aa3c2ef9aadcd8796ca961d;p=thirdparty%2Ffreeradius-server.git free the filter on error path. Fixes #4881 --- diff --git a/src/lib/util/pcap.c b/src/lib/util/pcap.c index 60332a82440..f73b5e5cece 100644 --- a/src/lib/util/pcap.c +++ b/src/lib/util/pcap.c @@ -404,8 +404,9 @@ int fr_pcap_apply_filter(fr_pcap_t *pcap, char const *expression) } if (pcap_setfilter(pcap->handle, &fp) < 0) { - fr_strerror_printf("%s", pcap_geterr(pcap->handle)); + pcap_freecode(&fp); + fr_strerror_printf("%s", pcap_geterr(pcap->handle)); return -1; }