From: Jason Ish Date: Fri, 24 Jan 2025 17:18:54 +0000 (-0600) Subject: ndpi: fix memory in keyword setup X-Git-Tag: suricata-8.0.0-beta1~178 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=10ed6280ffb079944e2548e9a18c698ee969049d;p=thirdparty%2Fsuricata.git ndpi: fix memory in keyword setup - remove duplicate calls to ndpi_init_detection_module - cleanup ndpi_init_detection_module when no longer needed --- diff --git a/plugins/ndpi/ndpi.c b/plugins/ndpi/ndpi.c index ec0342c78a..60accf4576 100644 --- a/plugins/ndpi/ndpi.c +++ b/plugins/ndpi/ndpi.c @@ -226,7 +226,6 @@ static DetectnDPIProtocolData *DetectnDPIProtocolParse(const char *arg, bool neg if (unlikely(ndpi_struct == NULL)) return NULL; - ndpi_struct = ndpi_init_detection_module(NULL); NDPI_BITMASK_SET_ALL(all); ndpi_set_protocol_detection_bitmask2(ndpi_struct, &all); ndpi_finalize_initialization(ndpi_struct); @@ -346,10 +345,10 @@ static DetectnDPIRiskData *DetectnDPIRiskParse(const char *arg, bool negate) if (unlikely(ndpi_struct == NULL)) return NULL; - ndpi_struct = ndpi_init_detection_module(NULL); NDPI_BITMASK_SET_ALL(all); ndpi_set_protocol_detection_bitmask2(ndpi_struct, &all); ndpi_finalize_initialization(ndpi_struct); + ndpi_exit_detection_module(ndpi_struct); if (isdigit(arg[0])) risk_mask = atoll(arg);