From: Arran Cudbard-Bell Date: Sat, 9 May 2020 15:16:23 +0000 (-0500) Subject: No reason to be lazy... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=11e4790afd6fc2a0625f83a8a2d2bc28d81b797c;p=thirdparty%2Ffreeradius-server.git No reason to be lazy... --- diff --git a/src/modules/proto_arp/proto_arp_ethernet.c b/src/modules/proto_arp/proto_arp_ethernet.c index 4ede083952b..e98462e9ce5 100644 --- a/src/modules/proto_arp/proto_arp_ethernet.c +++ b/src/modules/proto_arp/proto_arp_ethernet.c @@ -178,6 +178,7 @@ static int mod_open(fr_listen_t *li) CONF_SECTION *server_cs; CONF_ITEM *ci; char const *filter; + char *our_filter = NULL; thread->pcap = fr_pcap_init(thread, inst->interface, PCAP_INTERFACE_IN); if (!thread->pcap) { @@ -196,13 +197,15 @@ static int mod_open(fr_listen_t *li) if (!inst->filter) { filter = "arp"; } else { - filter = talloc_asprintf(li, "arp and %s", inst->filter); + MEM(filter = our_filter = talloc_asprintf(li, "arp and %s", inst->filter)); } if (fr_pcap_apply_filter(thread->pcap, filter) < 0) { PERROR("Failed applying pcap filter '%s'", filter); + talloc_free(our_filter); return -1; } + talloc_free(our_filter); li->fd = thread->pcap->fd;