detect/pcre: remove unused match member

pcre2_match_data is created per thread when needed.
pull/10134/head
Victor Julien 2 years ago committed by Victor Julien
parent 3e8db97687
commit f2e9c258c4

@ -2710,9 +2710,6 @@ void DetectParseFreeRegex(DetectParseRegex *r)
if (r->context) { if (r->context) {
pcre2_match_context_free(r->context); pcre2_match_context_free(r->context);
} }
if (r->match) {
pcre2_match_data_free(r->match);
}
} }
void DetectParseFreeRegexes(void) void DetectParseFreeRegexes(void)
@ -2738,7 +2735,6 @@ void DetectParseRegexAddToFreeList(DetectParseRegex *detect_parse)
FatalError("failed to alloc memory for pcre free list"); FatalError("failed to alloc memory for pcre free list");
} }
r->regex = detect_parse->regex; r->regex = detect_parse->regex;
r->match = detect_parse->match;
r->next = g_detect_parse_regex_list; r->next = g_detect_parse_regex_list;
g_detect_parse_regex_list = r; g_detect_parse_regex_list = r;
} }
@ -2758,8 +2754,6 @@ bool DetectSetupParseRegexesOpts(const char *parse_str, DetectParseRegex *detect
parse_str, en, errbuffer); parse_str, en, errbuffer);
return false; return false;
} }
detect_parse->match = pcre2_match_data_create_from_pattern(detect_parse->regex, NULL);
DetectParseRegexAddToFreeList(detect_parse); DetectParseRegexAddToFreeList(detect_parse);
return true; return true;
@ -2785,7 +2779,6 @@ DetectParseRegex *DetectSetupPCRE2(const char *parse_str, int opts)
SCFree(detect_parse); SCFree(detect_parse);
return NULL; return NULL;
} }
detect_parse->match = pcre2_match_data_create_from_pattern(detect_parse->regex, NULL);
detect_parse->next = g_detect_parse_regex_list; detect_parse->next = g_detect_parse_regex_list;
g_detect_parse_regex_list = detect_parse; g_detect_parse_regex_list = detect_parse;

@ -62,7 +62,6 @@ enum {
typedef struct DetectParseRegex { typedef struct DetectParseRegex {
pcre2_code *regex; pcre2_code *regex;
pcre2_match_context *context; pcre2_match_context *context;
pcre2_match_data *match;
struct DetectParseRegex *next; struct DetectParseRegex *next;
} DetectParseRegex; } DetectParseRegex;

@ -678,7 +678,6 @@ static DetectPcreData *DetectPcreParse (DetectEngineCtx *de_ctx,
SCLogError("pcre2 could not create match context"); SCLogError("pcre2 could not create match context");
goto error; goto error;
} }
pd->parse_regex.match = pcre2_match_data_create_from_pattern(pd->parse_regex.regex, NULL);
if (apply_match_limit) { if (apply_match_limit) {
if (pcre_match_limit >= -1) { if (pcre_match_limit >= -1) {

Loading…
Cancel
Save