diff --git a/src/detect-engine.c b/src/detect-engine.c index 50298309ea..11a06d969c 100644 --- a/src/detect-engine.c +++ b/src/detect-engine.c @@ -421,6 +421,13 @@ static void *DetectEngineLiveRuleSwap(void *arg) SCLogError(SC_ERR_NO_RULES_LOADED, "Loading signatures failed."); if (de_ctx->failure_fatal) exit(EXIT_FAILURE); + DetectEngineCtxFree(de_ctx); + SCLogError(SC_ERR_LIVE_RULE_SWAP, "Failure encountered while " + "loading new ruleset with live swap."); + SCLogInfo("===== Live rule swap DONE ====="); + TmThreadsSetFlag(tv_local, THV_CLOSED); + pthread_exit(NULL); + return NULL; } SCThresholdConfInitContext(de_ctx, NULL); diff --git a/src/util-error.c b/src/util-error.c index 96b33c0b1a..db91a3b2fb 100644 --- a/src/util-error.c +++ b/src/util-error.c @@ -245,6 +245,7 @@ const char * SCErrorToString(SCError err) CASE_CODE (SC_ERR_DEFRAG_INIT); CASE_CODE (SC_ERR_NO_REPUTATION); CASE_CODE (SC_ERR_NOT_SUPPORTED); + CASE_CODE (SC_ERR_LIVE_RULE_SWAP); default: return "UNKNOWN_ERROR"; } diff --git a/src/util-error.h b/src/util-error.h index 2f823246ae..932871094b 100644 --- a/src/util-error.h +++ b/src/util-error.h @@ -258,6 +258,7 @@ typedef enum { SC_ERR_IPFW_SETSOCKOPT, SC_ERR_NO_GEOIP_SUPPORT, SC_ERR_GEOIP_ERROR, + SC_ERR_LIVE_RULE_SWAP, } SCError; const char *SCErrorToString(SCError);