updategetbyid memory leak

This commit is contained in:
brenosilva
2012-03-08 15:48:44 +00:00
parent c2595965da
commit a44990ab42
2 changed files with 15 additions and 6 deletions

View File

@@ -5,6 +5,8 @@
* Fixed ModSecurity cannot load session and user sdbm data. * Fixed ModSecurity cannot load session and user sdbm data.
* Fixed updateTargetById was creating rule unparsed content making apache memory grow.
* Code cleanup. * Code cleanup.
23 Feb 2012 - 2.6.4-rc1 23 Feb 2012 - 2.6.4-rc1

View File

@@ -237,17 +237,24 @@ char *update_rule_target(cmd_parms *cmd, directory_config *dcfg,
p = apr_strtok(NULL,",",&savedptr); p = apr_strtok(NULL,",",&savedptr);
} }
curr_targets = msre_generate_target_string(ruleset->mp, rule); if(match == 0) {
curr_targets = msre_generate_target_string(ruleset->mp, rule);
rule->unparsed = msre_rule_generate_unparsed(ruleset->mp, rule, curr_targets, NULL, NULL); rule->unparsed = msre_rule_generate_unparsed(ruleset->mp, rule, curr_targets, NULL, NULL);
}
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;
} }