ndpi: fix memory in keyword setup

- remove duplicate calls to ndpi_init_detection_module
- cleanup ndpi_init_detection_module when no longer needed
pull/12875/head
Jason Ish 1 year ago committed by Victor Julien
parent d3835bbb11
commit 10ed6280ff

@ -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);

Loading…
Cancel
Save