]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
tls.store: cleanup
authorVictor Julien <victor@inliniac.net>
Wed, 21 Dec 2016 18:43:25 +0000 (19:43 +0100)
committerVictor Julien <victor@inliniac.net>
Thu, 16 Feb 2017 09:35:41 +0000 (10:35 +0100)
src/detect-tls.c

index 4b5db38213b21de9f9a8b6b8838be31f838c9dab..c86e55f20cb33ad9a5f60eabba1101b93a5d5ce7 100644 (file)
@@ -783,30 +783,22 @@ static int DetectTlsStoreSetup (DetectEngineCtx *de_ctx, Signature *s, char *str
 {
     SigMatch *sm = NULL;
 
-    s->flags |= SIG_FLAG_TLSSTORE;
-
-    sm = SigMatchAlloc();
-    if (sm == NULL)
-        goto error;
-
     if (s->alproto != ALPROTO_UNKNOWN && s->alproto != ALPROTO_TLS) {
         SCLogError(SC_ERR_CONFLICTING_RULE_KEYWORDS, "rule contains conflicting keywords.");
-        goto error;
+        return -1;
     }
 
+    sm = SigMatchAlloc();
+    if (sm == NULL)
+        return -1;
+
     sm->type = DETECT_AL_TLS_STORE;
     s->flags |= SIG_FLAG_APPLAYER;
     s->alproto = ALPROTO_TLS;
+    s->flags |= SIG_FLAG_TLSSTORE;
 
     SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_AMATCH);
-
     return 0;
-
-error:
-    if (sm != NULL)
-        SCFree(sm);
-    return -1;
-
 }
 
 /** \warning modifies state */