detect/alert: directly increment alerts.discarded

In the unlikely case of AlertQueueExpand failure, we were incrementing
the discarded alerts stats in AlertQueueAppend via the Packet member in the
DetectEngineThreadCtx, which may not be initialized yet.

Bug #5353
pull/7423/head
Juliana Fajardini 3 years ago committed by Victor Julien
parent d745d28d4a
commit 28ac75b505

@ -268,7 +268,7 @@ void AlertQueueAppend(DetectEngineThreadCtx *det_ctx, const Signature *s, Packet
/* we must grow the alert queue */
if (pos == AlertQueueExpand(det_ctx)) {
/* this means we failed to expand the queue */
det_ctx->p->alerts.discarded++;
p->alerts.discarded++;
return;
}
}

Loading…
Cancel
Save