Skip to content

Commit

Permalink
detect-tls: fix memleaks
Browse files Browse the repository at this point in the history
  • Loading branch information
regit committed Mar 7, 2016
1 parent a53aef9 commit 50ea76a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/detect-tls.c
Expand Up @@ -277,6 +277,7 @@ static DetectTlsData *DetectTlsSubjectParse (char *str)
}
if (str_ptr[0] == '!')
flag = DETECT_CONTENT_NEGATED;
pcre_free_substring(str_ptr);

res = pcre_get_substring((char *)str, ov, MAX_SUBSTRINGS, 2, &str_ptr);
if (res < 0) {
Expand All @@ -295,6 +296,8 @@ static DetectTlsData *DetectTlsSubjectParse (char *str)
if (unlikely(orig == NULL)) {
goto error;
}
pcre_free_substring(str_ptr);

tmp_str=orig;

/* Let's see if we need to escape "'s */
Expand Down Expand Up @@ -484,6 +487,7 @@ static DetectTlsData *DetectTlsIssuerDNParse(char *str)
}
if (str_ptr[0] == '!')
flag = DETECT_CONTENT_NEGATED;
pcre_free_substring(str_ptr);

res = pcre_get_substring((char *)str, ov, MAX_SUBSTRINGS, 2, &str_ptr);
if (res < 0) {
Expand All @@ -502,6 +506,8 @@ static DetectTlsData *DetectTlsIssuerDNParse(char *str)
if (unlikely(orig == NULL)) {
goto error;
}
pcre_free_substring(str_ptr);

tmp_str=orig;

/* Let's see if we need to escape "'s */
Expand Down Expand Up @@ -627,6 +633,7 @@ static DetectTlsData *DetectTlsFingerprintParse (char *str)
}
if (str_ptr[0] == '!')
flag = DETECT_CONTENT_NEGATED;
pcre_free_substring(str_ptr);

res = pcre_get_substring((char *)str, ov, MAX_SUBSTRINGS, 2, &str_ptr);
if (res < 0) {
Expand All @@ -645,6 +652,8 @@ static DetectTlsData *DetectTlsFingerprintParse (char *str)
if (unlikely(orig == NULL)) {
goto error;
}
pcre_free_substring(str_ptr);

tmp_str=orig;

/* Let's see if we need to escape "'s */
Expand Down

0 comments on commit 50ea76a

Please sign in to comment.