diff --git a/src/stream-tcp-reassemble.c b/src/stream-tcp-reassemble.c index e61e3db701..4665a9b1a3 100644 --- a/src/stream-tcp-reassemble.c +++ b/src/stream-tcp-reassemble.c @@ -444,8 +444,11 @@ TcpReassemblyThreadCtx *StreamTcpReassembleInitThreadCtx(ThreadVars *tv) ra_ctx->segment_thread_pool_id); } SCMutexUnlock(&segment_thread_pool_mutex); - if (ra_ctx->segment_thread_pool_id < 0 || segment_thread_pool == NULL) - abort(); + if (ra_ctx->segment_thread_pool_id < 0 || segment_thread_pool == NULL) { + SCLogError(SC_ERR_MEM_ALLOC, "failed to setup/expand stream segment pool. Expand stream.reassembly.memcap?"); + StreamTcpReassembleFreeThreadCtx(ra_ctx); + SCReturnPtr(NULL, "TcpReassemblyThreadCtx"); + } SCReturnPtr(ra_ctx, "TcpReassemblyThreadCtx"); } diff --git a/src/stream-tcp.c b/src/stream-tcp.c index dfc956c13a..d99d0c255d 100644 --- a/src/stream-tcp.c +++ b/src/stream-tcp.c @@ -4984,8 +4984,10 @@ TmEcode StreamTcpThreadInit(ThreadVars *tv, void *initdata, void **data) SCLogDebug("pool size %d, thread ssn_pool_id %d", PoolThreadSize(ssn_pool), stt->ssn_pool_id); } SCMutexUnlock(&ssn_pool_mutex); - if (stt->ssn_pool_id < 0 || ssn_pool == NULL) + if (stt->ssn_pool_id < 0 || ssn_pool == NULL) { + SCLogError(SC_ERR_MEM_ALLOC, "failed to setup/expand stream session pool. Expand stream.memcap?"); SCReturnInt(TM_ECODE_FAILED); + } SCReturnInt(TM_ECODE_OK); }