Index | Thread | Search

From:
Rafael Sadowski <rafael@sizeofvoid.org>
Subject:
relayd: fix memory leak in rsae_send_imsg
To:
tech@openbsd.org
Date:
Mon, 23 Feb 2026 21:33:42 +0100

Download raw body.

Thread
Looks like we're leaking memory in rsae_send_imsg. If the cookie doesn't
match, we bail with a continue and totally forget to free the imsg.

diff --git a/usr.sbin/relayd/ca.c b/usr.sbin/relayd/ca.c
index e54259c5971..f44a9d2a556 100644
--- a/usr.sbin/relayd/ca.c
+++ b/usr.sbin/relayd/ca.c
@@ -380,6 +380,7 @@ rsae_send_imsg(int flen, const u_char *from, u_char *to, RSA *rsa,
 				    "%s: priv%s obsolete keyop #%x", __func__,
 				    cmd == IMSG_CA_PRIVENC ? "enc" : "dec",
 				    cko.cko_cookie);
+				imsg_free(&imsg);
 				continue;
 			}