From: Philippe Antoine Date: Thu, 18 Mar 2021 15:07:55 +0000 (+0100) Subject: transform: use generic Free function X-Git-Tag: suricata-7.0.0-beta1~1373 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ae4e3e95d5890b650b9c388b807195adb2f130e7;p=thirdparty%2Fsuricata.git transform: use generic Free function to free subelements in the context structure --- diff --git a/src/detect-engine-build.c b/src/detect-engine-build.c index 6a2790f73e..c5eef029f4 100644 --- a/src/detect-engine-build.c +++ b/src/detect-engine-build.c @@ -1908,7 +1908,9 @@ static int SigMatchPrepare(DetectEngineCtx *de_ctx) SCFree(s->init_data->smlists_tail); for (i = 0; i < (uint32_t)s->init_data->transforms.cnt; i++) { if (s->init_data->transforms.transforms[i].options) { - SCFree(s->init_data->transforms.transforms[i].options); + int transform = s->init_data->transforms.transforms[i].transform; + sigmatch_table[transform].Free( + de_ctx, s->init_data->transforms.transforms[i].options); s->init_data->transforms.transforms[i].options = NULL; } } diff --git a/src/detect-parse.c b/src/detect-parse.c index 35c8085c82..909c2f1477 100644 --- a/src/detect-parse.c +++ b/src/detect-parse.c @@ -1401,7 +1401,9 @@ void SigFree(DetectEngineCtx *de_ctx, Signature *s) if (s->init_data && s->init_data->transforms.cnt) { for(i = 0; i < s->init_data->transforms.cnt; i++) { if (s->init_data->transforms.transforms[i].options) { - SCFree(s->init_data->transforms.transforms[i].options); + int transform = s->init_data->transforms.transforms[i].transform; + sigmatch_table[transform].Free( + de_ctx, s->init_data->transforms.transforms[i].options); s->init_data->transforms.transforms[i].options = NULL; } }