[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnurl] 116/151: curl: improved cleanup in upload error path
From: |
gnunet |
Subject: |
[gnurl] 116/151: curl: improved cleanup in upload error path |
Date: |
Fri, 20 Dec 2019 14:27:05 +0100 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit dc4900eea7317c67116fd5e6cd31863775da88ed
Author: Daniel Stenberg <address@hidden>
AuthorDate: Wed Dec 11 11:16:12 2019 +0100
curl: improved cleanup in upload error path
Memory leak found by torture test 58
Closes #4705
---
src/tool_operhlp.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/tool_operhlp.c b/src/tool_operhlp.c
index 543bf4302..8a9b7c9e8 100644
--- a/src/tool_operhlp.c
+++ b/src/tool_operhlp.c
@@ -115,16 +115,17 @@ char *add_file_name_to_url(char *url, const char
*filename)
urlbuffer = aprintf("%s/%s", url, encfile);
curl_free(encfile);
- Curl_safefree(url);
- if(!urlbuffer)
- return NULL;
+ if(!urlbuffer) {
+ url = NULL;
+ goto end;
+ }
+ Curl_safefree(url);
url = urlbuffer; /* use our new URL instead! */
}
- else
- Curl_safefree(url);
}
+ end:
curl_easy_cleanup(curl);
return url;
}
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [gnurl] 83/151: github action/azure pipeline: run 'make test-nonflaky' for tests, (continued)
- [gnurl] 83/151: github action/azure pipeline: run 'make test-nonflaky' for tests, gnunet, 2019/12/20
- [gnurl] 82/151: openssl: CURLSSLOPT_NO_PARTIALCHAIN can disable partial cert chains, gnunet, 2019/12/20
- [gnurl] 85/151: configure: enable IPv6 support without `getaddrinfo`, gnunet, 2019/12/20
- [gnurl] 87/151: CURLOPT_VERBOSE.3: see also ERRORBUFFER, gnunet, 2019/12/20
- [gnurl] 98/151: curl: make the etag load logic work without fseek, gnunet, 2019/12/20
- [gnurl] 103/151: winbuild: Define CARES_STATICLIB when WITH_CARES=static, gnunet, 2019/12/20
- [gnurl] 90/151: test342: make it return a 304 as the tag matches, gnunet, 2019/12/20
- [gnurl] 99/151: azure: add a vanilla macos build, gnunet, 2019/12/20
- [gnurl] 105/151: tests: fix permissions of ssh keys in WSL, gnunet, 2019/12/20
- [gnurl] 102/151: conn: always set bits.close with connclose(), gnunet, 2019/12/20
- [gnurl] 116/151: curl: improved cleanup in upload error path,
gnunet <=
- [gnurl] 108/151: azure: add libssh2 and cmake macos builds, gnunet, 2019/12/20
- [gnurl] 107/151: curl: use errorf() better, gnunet, 2019/12/20
- [gnurl] 114/151: travis: make torture use --shallow=40, gnunet, 2019/12/20
- [gnurl] 119/151: altsvc: make the save function ignore NULL filenames, gnunet, 2019/12/20
- [gnurl] 118/151: curl: fix memory leak in OOM in etags logic, gnunet, 2019/12/20
- [gnurl] 123/151: unit1609: fix mem-leak in OOM, gnunet, 2019/12/20
- [gnurl] 125/151: cirrus: Drop the FreeBSD 10.4 build, gnunet, 2019/12/20
- [gnurl] 96/151: docs: fix some typos, gnunet, 2019/12/20
- [gnurl] 94/151: lib: fix some loose ends for recently added CURLSSLOPT_NO_PARTIALCHAIN, gnunet, 2019/12/20
- [gnurl] 89/151: CMake: add support for building with the NSS vtls backend, gnunet, 2019/12/20