From 931bbfeb2c92ecaa8ca2262b9bef27df8614ffb9 Mon Sep 17 00:00:00 2001 From: Eric Fahlgren Date: Mon, 10 Nov 2025 13:18:04 -0800 Subject: [PATCH] ucode: fix memory leak when using ssl context Check for and free any SSL context when freeing uclient object. Fixes: https://github.com/openwrt/uclient/issues/11 Signed-off-by: Eric Fahlgren Signed-off-by: Felix Fietkau --- ucode.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ucode.c b/ucode.c index fa60806..ba65e63 100644 --- a/ucode.c +++ b/ucode.c @@ -55,6 +55,8 @@ static void free_uclient(void *ptr) return; ucl = cl->priv; + if (ucl->ssl_ctx) + ucl->ssl_ops->context_free(ucl->ssl_ctx); ucv_array_set(registry, ucl->idx, NULL); ucv_array_set(registry, ucl->idx + 1, NULL); uclient_free(cl); -- 2.30.2