Index | Thread | Search

From:
Jan Schreiber <jes@posteo.de>
Subject:
relayd: free tls_cfg on error
To:
tech@openbsd.org
Date:
Wed, 01 Apr 2026 20:13:23 +0000

Download raw body.

Thread
  • Jan Schreiber:

    relayd: free tls_cfg on error

Hi,

to me it looks like tls_cfg is not freed when the early return happens.
This patch uses goto err like the other parts of the function.

diff --git usr.sbin/relayd/relay.c usr.sbin/relayd/relay.c
index e2aa0625572..fcb1336aeef 100644
--- usr.sbin/relayd/relay.c
+++ usr.sbin/relayd/relay.c
@@ -2156,7 +2156,7 @@ relay_tls_ctx_create(struct relay *rlay)
         }
         if ((tls_client_cfg = tls_config_new()) == NULL) {
                 log_warnx("unable to allocate TLS config");
-               return (-1);
+               goto err;
         }