From: Victor Julien Date: Mon, 16 Sep 2013 14:18:52 +0000 (+0200) Subject: Coverity 1038133 fix X-Git-Tag: suricata-2.0beta2~370 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=38b6103ff5b7b0ba4edf32eb82e32a1be77da2b9;p=thirdparty%2Fsuricata.git Coverity 1038133 fix Clean up parsing code to suppress Coverity: Dereference before null check (REVERSE_INULL) Proper checking was already done. --- diff --git a/src/detect-detection-filter.c b/src/detect-detection-filter.c index 83cd7a0dd8..6d9e6c7ee5 100644 --- a/src/detect-detection-filter.c +++ b/src/detect-detection-filter.c @@ -133,13 +133,10 @@ DetectThresholdData *DetectDetectionFilterParse (char *rawstr) { if(strstr(df_opt,"track")) track_found++; } + SCFree(copy_str); + copy_str = NULL; - if (copy_str) { - SCFree(copy_str); - copy_str = NULL; - } - - if(count_found != 1 || seconds_found != 1 || track_found != 1) + if (count_found != 1 || seconds_found != 1 || track_found != 1) goto error; ret = pcre_exec(parse_regex, parse_regex_study, rawstr, strlen(rawstr), 0, 0, ov, MAX_SUBSTRINGS); @@ -207,8 +204,6 @@ error: } if (df != NULL) SCFree(df); - if (copy_str != NULL) - SCFree(copy_str); return NULL; }