From 7e469bc926177ca77079a82bfe720dc995f2acf7 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Mon, 30 May 2011 11:46:23 +0200 Subject: [PATCH] Properly free data in tag match function. --- src/detect-tag.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/detect-tag.c b/src/detect-tag.c index afa750a660..f90170a901 100644 --- a/src/detect-tag.c +++ b/src/detect-tag.c @@ -200,8 +200,9 @@ int DetectTagMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, Si } else { SCLogError(SC_ERR_INVALID_VALUE, "Error on direction of a tag keyword (not src nor dst)"); + SCFree(tde); } - break; + break; case DETECT_TAG_TYPE_SESSION: if (p->flow != NULL) { /* If it already exists it will be updated */ @@ -211,11 +212,13 @@ int DetectTagMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, Si SC_ATOMIC_ADD(num_tags, 1); } else { SCLogDebug("No flow to append the session tag"); + SCFree(tde); } - break; + break; default: SCLogError(SC_ERR_INVALID_VALUE, "Error on type of a tag keyword (not session nor host)"); - break; + SCFree(tde); + break; } return 1;