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.
pull/14025/head
Victor Julien 1 month ago committed by Victor Julien
parent 3babd68af4
commit ce9c7a024e

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