Skip to content

Commit

Permalink
output: harden output deinit
Browse files Browse the repository at this point in the history
If thread setup fails allow output deinit code to be called with
NULL data without crashing.
  • Loading branch information
victorjulien committed Oct 17, 2017
1 parent 9fdecff commit aab2548
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/output.c
Original file line number Diff line number Diff line change
Expand Up @@ -966,6 +966,9 @@ TmEcode OutputLoggerThreadInit(ThreadVars *tv, void *initdata, void **data)

TmEcode OutputLoggerThreadDeinit(ThreadVars *tv, void *thread_data)
{
if (thread_data == NULL)
return TM_ECODE_FAILED;

LoggerThreadStore *thread_store = (LoggerThreadStore *)thread_data;
RootLogger *logger = TAILQ_FIRST(&RootLoggers);
LoggerThreadStoreNode *thread_store_node = TAILQ_FIRST(thread_store);
Expand Down

0 comments on commit aab2548

Please sign in to comment.