]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
free the filter on error path. Fixes #4881
authorAlan T. DeKok <aland@freeradius.org>
Fri, 3 Feb 2023 13:11:10 +0000 (08:11 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 3 Feb 2023 13:11:10 +0000 (08:11 -0500)
src/lib/util/pcap.c

index 60332a824405cb09959b3e955e1ae43482d6258a..f73b5e5cecedeb5d1882d68f5d73b0fcd9cfa65f 100644 (file)
@@ -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;
        }