Skip to content
Commit 761f1c4b authored by Marcin Niestroj's avatar Marcin Niestroj Committed by Jukka Rissanen
Browse files

net: tls: fix tls_context leak in ztls_socket() error path



If there are enough tls_context objects in the system (configured by
CONFIG_NET_SOCKETS_TLS_MAX_CONTEXTS), but there are not enough file
descriptors (configured by CONFIG_POSIX_MAX_FDS) to create underneath
TCP/UDP socket, then TLS socket creation fails with leaked tls_context.

Call tls_release() in ztls_socket() error path whenever underneath
TCP/UDP socket creation fails.

Signed-off-by: default avatarMarcin Niestroj <m.niestroj@grinn-global.com>
parent a6d32a7a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment