Merge in SNORT/snort3 from ~STECHEW/snort3:slow_reload_fix to master
Squashed commit of the following:
commit
12055a3409f2373424b8e1c0cd418f654e27bc4d
Author: Steve Chew <stechew@cisco.com>
Date: Tue Nov 15 13:29:18 2022 -0500
smtp: Do not accumulate cmds across policies and reloads. Avoids memory and performance problem.
while ( (cmd = mod->get_cmd(i++)) )
smtp->ProcessSmtpCmdsList(cmd);
+ mod->clear_cmds();
+
return smtp;
}
delete config;
}
- for ( auto p : cmds )
- delete p;
+ clear_cmds();
}
const RuleMap* SmtpModule::get_rules() const
return nullptr;
}
+void SmtpModule::clear_cmds()
+{
+ for ( auto p : cmds )
+ delete p;
+
+ cmds.clear();
+}
+
bool SmtpModule::set(const char*, Value& v, SnortConfig*)
{
if ( v.is("auth_cmds") )
SmtpProtoConf* get_data();
const SmtpCmd* get_cmd(unsigned idx);
+ void clear_cmds();
Usage get_usage() const override
{ return INSPECT; }