diff options
author | Felix Fietkau <nbd@openwrt.org> | 2016-01-16 20:13:36 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2016-01-16 22:18:55 +0100 |
commit | 77164692aaeb4b18772df7e8bb7fdcb5eed45313 (patch) | |
tree | c3146c8fd216d63be7169c5bf43aa62555462e10 /uclient.c | |
parent | a7bfe2ff1df0743b3c34d78b14eb8b5c6b239a40 (diff) | |
download | uclient-77164692aaeb4b18772df7e8bb7fdcb5eed45313.tar.gz |
core: fix memory leak if url change fails
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Diffstat (limited to 'uclient.c')
-rw-r--r-- | uclient.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -182,8 +182,10 @@ int uclient_set_url(struct uclient *cl, const char *url_str, const char *auth_st if (!url) return -1; - if (url->backend != cl->backend) + if (url->backend != cl->backend) { + free(url); return -1; + } free(cl->url); cl->url = url; |