]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect/pcre: remove unused match member
authorVictor Julien <vjulien@oisf.net>
Mon, 18 Dec 2023 10:29:01 +0000 (11:29 +0100)
committerVictor Julien <victor@inliniac.net>
Mon, 8 Jan 2024 19:23:28 +0000 (20:23 +0100)
pcre2_match_data is created per thread when needed.

src/detect-parse.c
src/detect-parse.h
src/detect-pcre.c

index bf4684045898e3191a80caf38fd99afe79806b7e..c259fd36f943a314c22e53953c82416825e54c43 100644 (file)
@@ -2710,9 +2710,6 @@ void DetectParseFreeRegex(DetectParseRegex *r)
     if (r->context) {
         pcre2_match_context_free(r->context);
     }
-    if (r->match) {
-        pcre2_match_data_free(r->match);
-    }
 }
 
 void DetectParseFreeRegexes(void)
@@ -2738,7 +2735,6 @@ void DetectParseRegexAddToFreeList(DetectParseRegex *detect_parse)
         FatalError("failed to alloc memory for pcre free list");
     }
     r->regex = detect_parse->regex;
-    r->match = detect_parse->match;
     r->next = g_detect_parse_regex_list;
     g_detect_parse_regex_list = r;
 }
@@ -2758,8 +2754,6 @@ bool DetectSetupParseRegexesOpts(const char *parse_str, DetectParseRegex *detect
                 parse_str, en, errbuffer);
         return false;
     }
-    detect_parse->match = pcre2_match_data_create_from_pattern(detect_parse->regex, NULL);
-
     DetectParseRegexAddToFreeList(detect_parse);
 
     return true;
@@ -2785,7 +2779,6 @@ DetectParseRegex *DetectSetupPCRE2(const char *parse_str, int opts)
         SCFree(detect_parse);
         return NULL;
     }
-    detect_parse->match = pcre2_match_data_create_from_pattern(detect_parse->regex, NULL);
 
     detect_parse->next = g_detect_parse_regex_list;
     g_detect_parse_regex_list = detect_parse;
index 990180141058b1f85b141c1ff63537f035f8a5b1..900771a3a9e6a3e372ac24e495f32465697d12be 100644 (file)
@@ -62,7 +62,6 @@ enum {
 typedef struct DetectParseRegex {
     pcre2_code *regex;
     pcre2_match_context *context;
-    pcre2_match_data *match;
     struct DetectParseRegex *next;
 } DetectParseRegex;
 
index 0c22e8d8eafbc2af560ed4b04177bd31f7dfceeb..6d20dd08bb5d335a53661576d5f1746418c5e72d 100644 (file)
@@ -678,7 +678,6 @@ static DetectPcreData *DetectPcreParse (DetectEngineCtx *de_ctx,
         SCLogError("pcre2 could not create match context");
         goto error;
     }
-    pd->parse_regex.match = pcre2_match_data_create_from_pattern(pd->parse_regex.regex, NULL);
 
     if (apply_match_limit) {
         if (pcre_match_limit >= -1) {