ndpi: flow storage can fail, cleanup if it does

pull/16053/head
Jason Ish 3 months ago committed by Victor Julien
parent f739a8a73c
commit 038d4a21e3

@ -121,7 +121,10 @@ static void OnFlowInit(ThreadVars *tv, Flow *f, const Packet *p, void *_data)
memset(flowctx->ndpi_flow, 0, SIZEOF_FLOW_STRUCT);
flowctx->detection_completed = false;
SCFlowSetStorageById(f, flow_storage_id, flowctx);
if (SCFlowSetStorageById(f, flow_storage_id, flowctx) != 0) {
SCLogDebug("Failed to set nDPI flow storage");
FlowStorageFree(flowctx);
}
}
static void OnFlowUpdate(ThreadVars *tv, Flow *f, Packet *p, void *_data)

Loading…
Cancel
Save