From: Victor Julien Date: Fri, 2 Nov 2012 08:18:15 +0000 (+0100) Subject: flow: fix crash when flow engine under extreme stress, and unable to force free any... X-Git-Tag: suricata-1.4beta3~44 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=966c731e73a4b45c1cf5eb22f83364f9824664ff;p=thirdparty%2Fsuricata.git flow: fix crash when flow engine under extreme stress, and unable to force free any existing flow --- 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 {