Merge pull request #2992 from marcstern/v2/mst/expand_macros_optim

Avoid some useless code and memory allocation in case no macro is present
This commit is contained in:
Marc Stern
2024-02-01 11:57:17 +01:00
committed by GitHub

View File

@@ -273,6 +273,7 @@ int expand_macros(modsec_rec *msr, msc_string *var, msre_rule *rule, apr_pool_t
next_text_start = p + 1;
}
} else {
if (arr->nelts == 0) return 0; /* no macro */
/* Text part. */
part = (msc_string *)apr_pcalloc(mptmp, sizeof(msc_string));
part->value = apr_pstrdup(mptmp, text_start);