From: Felix Fietkau Date: Sat, 16 Jan 2016 19:13:36 +0000 (+0100) Subject: core: fix memory leak if url change fails X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=77164692aaeb4b18772df7e8bb7fdcb5eed45313;p=oweals%2Fuclient.git core: fix memory leak if url change fails Signed-off-by: Felix Fietkau --- diff --git a/uclient.c b/uclient.c index 21f6f5d..2113d8d 100644 --- a/uclient.c +++ b/uclient.c @@ -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;