detect/content: don't leak replace memory

Replace keyword updates a prior content with a heap allocation of the
pattern the content should be replaced with. Make sure this is freed as
well.

Bug: #7997.
(cherry picked from commit ce9c7a024e)
pull/14039/head
Victor Julien 6 months ago committed by Victor Julien
parent f9cddc004c
commit c12680de1b

@ -379,6 +379,8 @@ void DetectContentFree(DetectEngineCtx *de_ctx, void *ptr)
if (cd == NULL)
SCReturn;
if (cd->replace)
SCFree(cd->replace);
SpmDestroyCtx(cd->spm_ctx);
SCFree(cd);

Loading…
Cancel
Save