From: Philippe Antoine Date: Fri, 21 Jun 2024 17:32:32 +0000 (+0200) Subject: output/tx: use dynamic number of app-layer protos X-Git-Tag: suricata-8.0.0-beta1~1071 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6b56d5971a61947c93030532ca4da28099fa75c0;p=thirdparty%2Fsuricata.git output/tx: use dynamic number of app-layer protos OutputTxLoggerThreadData gets allocated after the number of app-layer protos is definite --- diff --git a/src/output-tx.c b/src/output-tx.c index 671829fb75..7bc569ef90 100644 --- a/src/output-tx.c +++ b/src/output-tx.c @@ -35,12 +35,11 @@ /** per thread data for this module, contains a list of per thread * data for the packet loggers. */ typedef struct OutputTxLoggerThreadData_ { - OutputLoggerThreadStore *store[ALPROTO_MAX]; - /* thread local data from file api */ OutputFileLoggerThreadData *file; /* thread local data from filedata api */ OutputFiledataLoggerThreadData *filedata; + OutputLoggerThreadStore *store[]; } OutputTxLoggerThreadData; /* logger instance, a module + a output ctx, @@ -542,7 +541,8 @@ end: * loggers */ static TmEcode OutputTxLogThreadInit(ThreadVars *tv, const void *_initdata, void **data) { - OutputTxLoggerThreadData *td = SCCalloc(1, sizeof(*td)); + OutputTxLoggerThreadData *td = + SCCalloc(1, sizeof(*td) + ALPROTO_MAX * sizeof(OutputLoggerThreadStore *)); if (td == NULL) return TM_ECODE_FAILED;