]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Properly clean signature's ip only data.
authorVictor Julien <victor@inliniac.net>
Mon, 2 Jul 2012 11:12:29 +0000 (13:12 +0200)
committerVictor Julien <victor@inliniac.net>
Mon, 2 Jul 2012 16:29:43 +0000 (18:29 +0200)
src/detect-engine-iponly.c
src/detect-parse.c

index 2f637cb18962e3e81fd0a2c5aba5666561919935..07887a7a9b3c6c1496d665e84d8f6d7eff0025ed 100644 (file)
@@ -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
index 40dc5158af70719b6d69e1fcdf0cec148bdd85a7..c79f8c88726f84cd2337dcd588a9f157b0bf9661 100644 (file)
@@ -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) {