Avoid some useless code and memory allocation in case no macro is present

This commit is contained in:
Marc Stern
2023-10-03 16:50:12 +02:00
parent e9bf697c00
commit 40c6f80ccf

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);