]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
flow: fix crash when flow engine under extreme stress, and unable to force free any...
authorVictor Julien <victor@inliniac.net>
Fri, 2 Nov 2012 08:18:15 +0000 (09:18 +0100)
committerVictor Julien <victor@inliniac.net>
Fri, 2 Nov 2012 08:19:01 +0000 (09:19 +0100)
src/flow-hash.c

index 283cbc480c07d5fb15056b65717d624ad8e408e5..f64aacd10bef1f042b7d04a0d435027706f8a751 100644 (file)
@@ -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 {