[openssl/openssl] 8819be: apps/s_server.c: fix SSL object leak on rpk_enable...
"'Mounir IDRASSI' via openssl-commits" <[email protected]>
| Newsgroups | gmane.comp.encryption.openssl.cvs |
|---|---|
| Message-ID | <openssl/openssl/push/refs/heads/openssl-4.0/[email protected]> |
Branch: refs/heads/openssl-4.0
Home: https://github.com/openssl/openssl
Commit: 8819bea3743bd6af87c9dfd78541a36bd875e438
https://github.com/openssl/openssl/commit/8819bea3743bd6af87c9dfd78541a36bd875e438
Author: Mounir IDRASSI <[email protected]>
Date: 2026-07-01 (Wed, 01 Jul 2026)
Changed paths:
M apps/s_server.c
Log Message:
-----------
apps/s_server.c: fix SSL object leak on rpk_enable() failure
In www_body() and rev_body(), con = SSL_new(ctx) is called before
rpk_enable(con), but ownership of con is transferred to ssl_bio only
later by BIO_set_ssl(..., BIO_CLOSE). If rpk_enable() fails, the code
jumps to err: before that transfer without freeing con, leaking the SSL
object.
Add SSL_free(con) before goto err in both rpk_enable() failure paths,
matching the adjacent SSL_set_session_id_context() and BIO_new_socket()
error paths. sv_body() is unaffected because its err: block already
frees con.
The global rpk_files is not leaked. Its lifetime is managed
by s_server_main(), which frees it in the end cleanup block.
Resolves: https://github.com/openssl/openssl/issues/31769
Reviewed-by: Matt Caswell <[email protected]>
Reviewed-by: Eugene Syromiatnikov <[email protected]>
MergeDate: Wed Jul 1 12:04:13 2026
(Merged from https://github.com/openssl/openssl/pull/31789)
(cherry picked from commit 2229aad774f6c7b7863b68320abf9a9cd134ab3c)
To unsubscribe from these emails, change your notification settings at https://github.com/openssl/openssl/settings/notifications
--
You received this message because you are subscribed to the Google Groups "openssl-commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/a/openssl.org/d/msgid/openssl-commits/openssl/openssl/push/refs/heads/openssl-4.0/bbd91a-8819be%40github.com.