diff --git a/src/parser/driver.cc b/src/parser/driver.cc index 3b0a6950..3cae46e7 100644 --- a/src/parser/driver.cc +++ b/src/parser/driver.cc @@ -66,6 +66,7 @@ int Driver::addSecRule(Rule *rule) { int Driver::parse(const std::string &f, const std::string &ref) { + lastRule = NULL; loc.push_back(new yy::location()); if (ref.empty()) { this->ref.push_back("<>"); diff --git a/src/rules.cc b/src/rules.cc index e9654908..5d9d15e0 100644 --- a/src/rules.cc +++ b/src/rules.cc @@ -251,7 +251,9 @@ int Rules::merge(Rules *from) { this->debugLog->refCountIncrease(); this->audit_log = from->audit_log; - this->audit_log->refCountIncrease(); + if (this->audit_log != NULL) { + this->audit_log->refCountIncrease(); + } this->debugLog->setDebugLevel(from->debugLevel); this->debugLog->setOutputFile(from->debug_log_path);