From af97c36c08e42605ee9bc319b7668010922cc809 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Mon, 2 Jul 2012 13:12:29 +0200 Subject: [PATCH] Properly clean signature's ip only data. --- src/detect-engine-iponly.c | 4 ++++ src/detect-parse.c | 6 ++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/detect-engine-iponly.c b/src/detect-engine-iponly.c index 2f637cb189..07887a7a9b 100644 --- a/src/detect-engine-iponly.c +++ b/src/detect-engine-iponly.c @@ -1515,6 +1515,10 @@ void IPOnlyAddSignature(DetectEngineCtx *de_ctx, DetectEngineIPOnlyCtx *io_ctx, /* enable the sig in the bitarray */ io_ctx->sig_init_array[(s->num/8)] |= 1 << (s->num % 8); + + /** no longer ref to this, it's in the table now */ + s->CidrSrc = NULL; + s->CidrDst = NULL; } #ifdef UNITTESTS diff --git a/src/detect-parse.c b/src/detect-parse.c index 40dc5158af..c79f8c8872 100644 --- a/src/detect-parse.c +++ b/src/detect-parse.c @@ -829,13 +829,11 @@ void SigFree(Signature *s) { if (s == NULL) return; - /* XXX GS there seems to be a bug in the IPOnlyCIDR list, which causes - system abort. */ - /*if (s->CidrDst != NULL) + if (s->CidrDst != NULL) IPOnlyCIDRListFree(s->CidrDst); if (s->CidrSrc != NULL) - IPOnlyCIDRListFree(s->CidrSrc);*/ + IPOnlyCIDRListFree(s->CidrSrc); SigMatch *sm = s->sm_lists[DETECT_SM_LIST_MATCH], *nsm; while (sm != NULL) {