summaryrefslogtreecommitdiff
path: root/runtime/ruleset.c
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/ruleset.c')
-rw-r--r--runtime/ruleset.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/runtime/ruleset.c b/runtime/ruleset.c
index 4bf8c05..8de7225 100644
--- a/runtime/ruleset.c
+++ b/runtime/ruleset.c
@@ -858,9 +858,16 @@ rulesetProcessCnf(struct cnfobj *o)
} else if(localRet != RS_RET_NOT_FOUND) {
ABORT_FINALIZE(localRet);
}
+
CHKiRet(rulesetConstruct(&pRuleset));
- CHKiRet(rulesetSetName(pRuleset, rsName));
- CHKiRet(rulesetConstructFinalize(loadConf, pRuleset));
+ if((localRet = rulesetSetName(pRuleset, rsName)) != RS_RET_OK) {
+ rulesetDestruct(&pRuleset);
+ ABORT_FINALIZE(localRet);
+ }
+ if((localRet = rulesetConstructFinalize(loadConf, pRuleset)) != RS_RET_OK) {
+ rulesetDestruct(&pRuleset);
+ ABORT_FINALIZE(localRet);
+ }
addScript(pRuleset, o->script);
/* we have only two params, so we do NOT do the usual param loop */
@@ -870,7 +877,7 @@ rulesetProcessCnf(struct cnfobj *o)
for(i = 0 ; i < ar->nmemb ; ++i) {
parserName = (uchar*)es_str2cstr(ar->arr[i], NULL);
doRulesetAddParser(pRuleset, parserName);
- free(parserName);
+ /* note parserName is freed in doRulesetAddParser()! */
}
}