mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-17 14:46:13 +03:00
Fixed 2 memory leaks
This commit is contained in:
parent
b3b33c9ff1
commit
25a60e259a
@ -386,8 +386,13 @@ 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)
|
||||||
|
free(target_list);
|
||||||
|
if(replace != NULL)
|
||||||
|
free(replace);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
is_negated = is_counting = 0;
|
is_negated = is_counting = 0;
|
||||||
param = name = value = NULL;
|
param = name = value = NULL;
|
||||||
@ -421,6 +426,8 @@ 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);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user