]> git.ipfire.org Git - thirdparty/openssl.git/commit
demos/bio/sconnect.c: Free ssl_bio on error to avoid memory leak
authorJiashengJiang <jiasheng@purdue.edu>
Fri, 16 May 2025 13:37:48 +0000 (09:37 -0400)
committerTomas Mraz <tomas@openssl.org>
Mon, 19 May 2025 14:22:57 +0000 (16:22 +0200)
commitdd67b64540c54f2f15d803b6146753dc3e8d6f45
tree1db94a7a42e1b0ed916185f67ab55b6c31532dbf
parent768bd0a1b27b6b10c3a19fdb4892831ed076f35a
demos/bio/sconnect.c: Free ssl_bio on error to avoid memory leak

Call BIO_free() to release ssl_bio if an error occurs before BIO_push(), preventing a memory leak.

Fixes: 396e720965 ("Fix certificate validation for IPv6 literals in sconnect demo")
Signed-off-by: JiashengJiang <jiasheng@purdue.edu>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27639)

(cherry picked from commit 55d8d859797e8229bc499bbc7c3c76821b654682)
demos/bio/sconnect.c