diff options
| author | Hauke Mehrtens | 2026-04-23 22:12:14 +0000 |
|---|---|---|
| committer | Hauke Mehrtens | 2026-06-07 11:23:14 +0000 |
| commit | 645236607a3d4166fd01f91a158dcb04ccb34d73 (patch) | |
| tree | a7ce3740d9ca1f753dd99749b2f7c881e38f7df9 | |
| parent | f227ab4f1285237d58f138a69fc69b37ae774b46 (diff) | |
| download | uclient-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.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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) |