mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 13:56:01 +03:00
Revert "Fixed 2 memory leaks"
This commit is contained in:
parent
feea267c79
commit
7828c63205
25
apache2/re.c
25
apache2/re.c
@ -378,7 +378,7 @@ char *update_rule_target_ex(modsec_rec *msr, msre_ruleset *ruleset, msre_rule *r
|
|||||||
}
|
}
|
||||||
#if !defined(MSC_TEST)
|
#if !defined(MSC_TEST)
|
||||||
else {
|
else {
|
||||||
ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL, " ModSecurity: Cannot find variable to replace");
|
ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL, " ModSecurity: Cannot find varibale to replace");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
goto end;
|
goto end;
|
||||||
@ -386,13 +386,8 @@ char *update_rule_target_ex(modsec_rec *msr, msre_ruleset *ruleset, msre_rule *r
|
|||||||
} else {
|
} else {
|
||||||
|
|
||||||
target = strdup(p);
|
target = strdup(p);
|
||||||
if(target == NULL) {
|
if(target == NULL)
|
||||||
if(target_list != NULL)
|
return NULL;
|
||||||
free(target_list);
|
|
||||||
if(replace != NULL)
|
|
||||||
free(replace);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
is_negated = is_counting = 0;
|
is_negated = is_counting = 0;
|
||||||
param = name = value = NULL;
|
param = name = value = NULL;
|
||||||
@ -426,8 +421,6 @@ char *update_rule_target_ex(modsec_rec *msr, msre_ruleset *ruleset, msre_rule *r
|
|||||||
free(target_list);
|
free(target_list);
|
||||||
if(replace != NULL)
|
if(replace != NULL)
|
||||||
free(replace);
|
free(replace);
|
||||||
if(target != NULL)
|
|
||||||
free(target);
|
|
||||||
if(msr) {
|
if(msr) {
|
||||||
msr_log(msr, 9, "Error to update target - [%s] is not valid target", name);
|
msr_log(msr, 9, "Error to update target - [%s] is not valid target", name);
|
||||||
}
|
}
|
||||||
@ -519,12 +512,18 @@ char *update_rule_target_ex(modsec_rec *msr, msre_ruleset *ruleset, msre_rule *r
|
|||||||
}
|
}
|
||||||
|
|
||||||
end:
|
end:
|
||||||
if(target_list != NULL)
|
if(target_list != NULL) {
|
||||||
free(target_list);
|
free(target_list);
|
||||||
if(replace != NULL)
|
target_list = NULL;
|
||||||
|
}
|
||||||
|
if(replace != NULL) {
|
||||||
free(replace);
|
free(replace);
|
||||||
if(target != NULL)
|
replace = NULL;
|
||||||
|
}
|
||||||
|
if(target != NULL) {
|
||||||
free(target);
|
free(target);
|
||||||
|
target = NULL;
|
||||||
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user