diff options
Diffstat (limited to 'src/tool_operhlp.c')
-rw-r--r-- | src/tool_operhlp.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/tool_operhlp.c b/src/tool_operhlp.c index 5a6a670f9..d7dbe13c1 100644 --- a/src/tool_operhlp.c +++ b/src/tool_operhlp.c @@ -132,6 +132,7 @@ char *add_file_name_to_url(CURL *curl, char *url, const char *filename) if(encfile) { char *urlbuffer = malloc(strlen(url) + strlen(encfile) + 3); if(!urlbuffer) { + curl_free(encfile); Curl_safefree(url); return NULL; } @@ -143,8 +144,8 @@ char *add_file_name_to_url(CURL *curl, char *url, const char *filename) sprintf(urlbuffer, "%s/%s", url, encfile); curl_free(encfile); - Curl_safefree(url); + url = urlbuffer; /* use our new URL instead! */ } } |