From: Alan T. DeKok Date: Sat, 9 May 2020 12:47:20 +0000 (-0400) Subject: just use talloc. Fixes #3444 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=89fb0644b474ee5c8058aa7fff0bd1e25830dd94;p=thirdparty%2Ffreeradius-server.git just use talloc. Fixes #3444 And use inst->filter for 'and %s', instead of the "filter" --- diff --git a/src/modules/proto_arp/proto_arp_ethernet.c b/src/modules/proto_arp/proto_arp_ethernet.c index d3e7170b59f..4ede083952b 100644 --- a/src/modules/proto_arp/proto_arp_ethernet.c +++ b/src/modules/proto_arp/proto_arp_ethernet.c @@ -178,7 +178,6 @@ static int mod_open(fr_listen_t *li) CONF_SECTION *server_cs; CONF_ITEM *ci; char const *filter; - char buffer[256]; thread->pcap = fr_pcap_init(thread, inst->interface, PCAP_INTERFACE_IN); if (!thread->pcap) { @@ -197,8 +196,7 @@ static int mod_open(fr_listen_t *li) if (!inst->filter) { filter = "arp"; } else { - filter = buffer; - snprintf(buffer, sizeof(buffer), "arp and %s", filter); + filter = talloc_asprintf(li, "arp and %s", inst->filter); } if (fr_pcap_apply_filter(thread->pcap, filter) < 0) {