]> git.ipfire.org Git - thirdparty/suricata.git/commit
pool: don't call Cleanup after failed Init 3898/head
authorVictor Julien <victor@inliniac.net>
Tue, 28 May 2019 13:45:37 +0000 (15:45 +0200)
committerVictor Julien <victor@inliniac.net>
Wed, 29 May 2019 13:34:36 +0000 (15:34 +0200)
commit9ea6db38896656f64499db62293dc15492206d71
tree9e3d90d8713489795d9918921222c28a7a0d42da
parent597ff3c8e315ebba704d0a70f08df7b1e3333c5f
pool: don't call Cleanup after failed Init

Stream reassembly memcap is regulated by the Init and Cleanup
callbacks. If Init fails due to memcap reached, Cleanup had no
way of knowing and it would decrease the memcap even if it hadn't
been increased by Init. This could lead to too much memory use and
memcap counter underflow.

This patch fixes the issue by not calling Cleanup in this case. It's
fair to see a failed Init the responsibility of Init.
src/util-pool.c