[openssl/openssl] 2229aa: 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/master/[email protected]>
  Branch: refs/heads/master
  Home:   https://github.com/openssl/openssl
  Commit: 2229aad774f6c7b7863b68320abf9a9cd134ab3c
      https://github.com/openssl/openssl/commit/2229aad774f6c7b7863b68320abf9a9cd134ab3c
  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)



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/master/10c092-2229aa%40github.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.