]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect/tos: minor cleanups
authorVictor Julien <victor@inliniac.net>
Thu, 21 Dec 2017 11:02:33 +0000 (12:02 +0100)
committerVictor Julien <victor@inliniac.net>
Thu, 21 Dec 2017 12:34:27 +0000 (13:34 +0100)
src/detect-tos.c

index 2d7c4e0a20545a540343207574be6fe29fb05212..609ff8c866050dccdecbeb98a869cb8ca81da70d 100644 (file)
@@ -170,18 +170,13 @@ error:
  * \retval  0 on Success.
  * \retval -1 on Failure.
  */
-int DetectTosSetup(DetectEngineCtx *de_ctx, Signature *s, const char *arg)
+static int DetectTosSetup(DetectEngineCtx *de_ctx, Signature *s, const char *arg)
 {
-    DetectTosData *tosd;
-    SigMatch *sm;
-
-    tosd = DetectTosParse(arg, s->init_data->negated);
+    DetectTosData *tosd = DetectTosParse(arg, s->init_data->negated);
     if (tosd == NULL)
         return -1;
 
-    /* Okay so far so good, lets get this into a SigMatch
-     * and put it in the Signature. */
-    sm = SigMatchAlloc();
+    SigMatch *sm = SigMatchAlloc();
     if (sm == NULL) {
         DetectTosFree(tosd);
         return -1;
@@ -192,7 +187,6 @@ int DetectTosSetup(DetectEngineCtx *de_ctx, Signature *s, const char *arg)
 
     SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_MATCH);
     s->flags |= SIG_FLAG_REQUIRE_PACKET;
-
     return 0;
 }
 
@@ -201,7 +195,7 @@ int DetectTosSetup(DetectEngineCtx *de_ctx, Signature *s, const char *arg)
  *
  * \param tosd Data to be freed.
  */
-void DetectTosFree(void *tosd)
+static void DetectTosFree(void *tosd)
 {
     SCFree(tosd);
 }