]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect/parser: minor cleanup
authorVictor Julien <victor@inliniac.net>
Mon, 7 Oct 2019 11:09:02 +0000 (13:09 +0200)
committerVictor Julien <victor@inliniac.net>
Wed, 9 Oct 2019 13:26:59 +0000 (15:26 +0200)
src/detect-parse.c

index 65e3b3564a798ba4167d9775318e6d9d844e6b87..b910d0d7612ccce6e63c77745c53576470d4c30c 100644 (file)
@@ -703,6 +703,8 @@ static int SigParseOptions(DetectEngineCtx *de_ctx, Signature *s, char *optstr,
 #undef URL
     }
 
+    int setup_ret = 0;
+
     /* Validate double quoting, trimming trailing white space along the way. */
     if (optvalue != NULL && strlen(optvalue) > 0) {
         size_t ovlen = strlen(optvalue);
@@ -783,16 +785,14 @@ static int SigParseOptions(DetectEngineCtx *de_ctx, Signature *s, char *optstr,
             }
         }
         /* setup may or may not add a new SigMatch to the list */
-        if (st->Setup(de_ctx, s, ptr) < 0) {
-            SCLogDebug("\"%s\" failed to setup", st->name);
-            goto error;
-        }
+        setup_ret = st->Setup(de_ctx, s, ptr);
     } else {
         /* setup may or may not add a new SigMatch to the list */
-        if (st->Setup(de_ctx, s, NULL) < 0) {
-            SCLogDebug("\"%s\" failed to setup", st->name);
-            goto error;
-        }
+        setup_ret = st->Setup(de_ctx, s, NULL);
+    }
+    if (setup_ret < 0) {
+        SCLogDebug("\"%s\" failed to setup", st->name);
+        goto error;
     }
     s->init_data->negated = false;