From 966c731e73a4b45c1cf5eb22f83364f9824664ff Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Fri, 2 Nov 2012 09:18:15 +0100 Subject: [PATCH] flow: fix crash when flow engine under extreme stress, and unable to force free any existing flow --- src/flow-hash.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/flow-hash.c b/src/flow-hash.c index 283cbc480c..f64aacd10b 100644 --- a/src/flow-hash.c +++ b/src/flow-hash.c @@ -425,6 +425,10 @@ static Flow *FlowGetNew(Packet *p) { } f = FlowGetUsedFlow(); + if (f == NULL) { + /* very rare, but we can fail. Just giving up */ + return NULL; + } /* freed a flow, but it's unlocked */ } else {