From 313067f47f27f949bfc74c1367144adbdd8f376d Mon Sep 17 00:00:00 2001 From: Gerardo Iglesias Galvan Date: Tue, 31 May 2011 20:23:36 -0500 Subject: [PATCH] Check return code of DetectEngineCtxInit at startup --- src/suricata.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/suricata.c b/src/suricata.c index 24e4546323..1e4196376f 100644 --- a/src/suricata.c +++ b/src/suricata.c @@ -1325,6 +1325,11 @@ int main(int argc, char **argv) FlowInitConfig(FLOW_VERBOSE); DetectEngineCtx *de_ctx = DetectEngineCtxInit(); + if (de_ctx == NULL) { + SCLogError(SC_ERR_INITIALIZATION, "initializing detection engine " + "context failed."); + exit(EXIT_FAILURE); + } SCClassConfLoadClassficationConfigFile(de_ctx); SCRConfLoadReferenceConfigFile(de_ctx);