mirror of https://github.com/OISF/suricata
ftp/expectation: fix IPPair lock+refcount leak on alloc fail
AppLayerExpectationCreate gets a locked and ref counted IPPair from IPPairGetIPPairFromHash. On the success path it correctly drops both with IPPairUnlock (keeping the ref for lifecycle). The else- branch that creates per-IPPair ExpectationLists calls SCCalloc. If that allocation fails, neither Unlock nor Release is called, leaving the IPPair mutex permanently held and its refcount elevated. Any subsequent worker thread that looks up the same IPPair blocks forever in SCCMutexLock. This patch addresses this by properly releasing the IPPair in the allocation error path. Ticket: #8851.pull/16213/head
parent
1eda7deb8d
commit
558945dc5e
Loading…
Reference in New Issue