Skip to content

Commit

Permalink
output/tx: use dynamic number of app-layer protos
Browse files Browse the repository at this point in the history
OutputTxLoggerThreadData gets allocated after the number of app-layer
protos is definite
  • Loading branch information
catenacyber authored and victorjulien committed Jul 2, 2024
1 parent 6a942f5 commit 6b56d59
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/output-tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -542,7 +541,8 @@ static TmEcode OutputTxLog(ThreadVars *tv, Packet *p, void *thread_data)
* 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;

Expand Down

0 comments on commit 6b56d59

Please sign in to comment.