summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Fahlgren2025-11-10 21:18:04 +0000
committerFelix Fietkau2026-01-31 13:56:34 +0000
commit931bbfeb2c92ecaa8ca2262b9bef27df8614ffb9 (patch)
treef6f1379c11dd377ad6219e10d0d7beee15ad12b0
parent80c9bd29c2331f34e91ec47fd7b486f58613a224 (diff)
downloaduclient-931bbfeb2c92ecaa8ca2262b9bef27df8614ffb9.tar.gz
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 <ericfahlgren@gmail.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r--ucode.c2
1 files changed, 2 insertions, 0 deletions
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);