Only call ThreadInit and ThreadDeinit for custom eve filetypes if they
exist. They are not required by all filetypes.
Ticket: #7359
&json_ctx->file_ctx->filetype.init_data) < 0) {
return -1;
}
- if (json_ctx->filetype->ThreadInit(json_ctx->file_ctx->filetype.init_data, 0,
- &json_ctx->file_ctx->filetype.thread_data) < 0) {
- return -1;
+ if (json_ctx->filetype->ThreadInit) {
+ if (json_ctx->filetype->ThreadInit(json_ctx->file_ctx->filetype.init_data, 0,
+ &json_ctx->file_ctx->filetype.thread_data) < 0) {
+ return -1;
+ }
}
json_ctx->file_ctx->filetype.filetype = json_ctx->filetype;
}
SCReturnInt(0);
}
- if (lf_ctx->type == LOGFILE_TYPE_FILETYPE) {
+ if (lf_ctx->type == LOGFILE_TYPE_FILETYPE && lf_ctx->filetype.filetype->ThreadDeinit) {
lf_ctx->filetype.filetype->ThreadDeinit(
lf_ctx->filetype.init_data, lf_ctx->filetype.thread_data);
}