BUG/MINOR: mux-spop: Fix null-pointer deref on SPOP stream allocation failure
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 4 Jun 2025 06:48:48 +0000 (08:48 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 17 Jun 2025 05:55:36 +0000 (07:55 +0200)
commit0f073704c5c549c35316b054844d2c686f5e5bd2
treedc7faff6c20c88892b832fd5b4692e20b4d842d6
parent2341a3c06afd1ec3a92d0df5766daf30360374d6
BUG/MINOR: mux-spop: Fix null-pointer deref on SPOP stream allocation failure

When we try to allocate a new SPOP stream, if an error is encountered,
spop_strm_destroy() is called to released the eventually allocated
stream. But, it must only be called if a stream was allocated. If the
reported error is an SPOP stream allocation failure, we must just leave to
avoid null-pointer dereference.

This patch should fix point 1 of the issue #2993. It must be backported as
far as 3.1.

(cherry picked from commit 8c4bb8cab37f72c451bc7685eaf58cb1c2f5fae2)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit f4f45adb3f98570d817c6e63b662001ca95292d3)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/mux_spop.c