summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHauke Mehrtens2026-04-23 22:12:14 +0000
committerHauke Mehrtens2026-06-07 11:23:14 +0000
commit645236607a3d4166fd01f91a158dcb04ccb34d73 (patch)
treea7ce3740d9ca1f753dd99749b2f7c881e38f7df9
parentf227ab4f1285237d58f138a69fc69b37ae774b46 (diff)
downloaduclient-645236607a3d4166fd01f91a158dcb04ccb34d73.tar.gz
uclient: free proxy_url in uclient_free
cl->proxy_url was allocated by uclient_set_proxy_url() but never freed on client destruction, leaking the struct (and the strings co-allocated with it) for every client that configured a proxy. Assisted-by: Claude:claude-opus-4-7 Link: https://github.com/openwrt/uclient/pull/16 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rw-r--r--uclient.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/uclient.c b/uclient.c
index 76f562c..915dc55 100644
--- a/uclient.c
+++ b/uclient.c
@@ -346,6 +346,7 @@ int uclient_connect(struct uclient *cl)
void uclient_free(struct uclient *cl)
{
struct uclient_url *url = cl->url;
+ struct uclient_url *proxy_url = cl->proxy_url;
if (cl->backend->free)
cl->backend->free(cl);
@@ -353,6 +354,7 @@ void uclient_free(struct uclient *cl)
free(cl);
free(url);
+ free(proxy_url);
}
int uclient_write(struct uclient *cl, const char *buf, int len)