]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Coverity 1038138 fix
authorVictor Julien <victor@inliniac.net>
Mon, 16 Sep 2013 14:26:11 +0000 (16:26 +0200)
committerVictor Julien <victor@inliniac.net>
Mon, 16 Sep 2013 14:26:11 +0000 (16:26 +0200)
Clean up parsing code to suppress Coverity:
Dereference before null check (REVERSE_INULL)

Proper checking was already done.

src/detect-threshold.c

index 11beed7ef6b2e7415d401ba08f7d14c306fcbdf1..1e935e28c6144d25be074ab29a31d2235059fa5a 100644 (file)
@@ -152,11 +152,8 @@ static DetectThresholdData *DetectThresholdParse (char *rawstr)
         if(strstr(threshold_opt,"track"))
             track_found++;
     }
-
-    if (copy_str != NULL) {
-        SCFree(copy_str);
-        copy_str = NULL;
-    }
+    SCFree(copy_str);
+    copy_str = NULL;
 
     if(count_found != 1 || second_found != 1 || type_found != 1 || track_found != 1)
         goto error;
@@ -226,8 +223,6 @@ error:
     }
     if (de != NULL)
         SCFree(de);
-    if (copy_str != NULL)
-        SCFree(copy_str);
     return NULL;
 }