BUG/MINOR: stconn: fix sedesc memory leak on stream allocation failure
authorWilly Tarreau <w@1wt.eu>
Mon, 20 Mar 2023 18:53:14 +0000 (19:53 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 20 Mar 2023 18:58:38 +0000 (19:58 +0100)
commit7a8ca0a0633e120c5b82de81f03c31cc39a17cb1
tree5d1f61e3d1b781452fb0f02ddbdea42317e0b751
parente2f7946339b539035b64f23912a227af98e4a609
BUG/MINOR: stconn: fix sedesc memory leak on stream allocation failure

If we fail to allocate a new stream in sc_new_from_endp(), and the call
to sc_new() allocated the sedesc itself (which normally doesn't happen),
then it doesn't get released on the failure path. Let's explicitly
handle this case so that it's not overlooked and avoids some head
scratching sessions.

This may be backported to 2.6.
src/stconn.c