From: Eric Fahlgren Date: Mon, 10 Nov 2025 21:18:04 +0000 (-0800) Subject: ucode: fix memory leak when using ssl context X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=931bbfeb2c92ecaa8ca2262b9bef27df8614ffb9;p=project%2Fuclient.git 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 --- 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);