[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 39/254: url: fixed a memory leak on OOM while setti
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 39/254: url: fixed a memory leak on OOM while setting CURLOPT_BUFFERSIZE |
Date: |
Sat, 17 Jun 2017 16:51:11 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to annotated tag gnurl-7.54.1
in repository gnurl.
commit 12e7a8c3d609d6a6094a7db8fb8c0cc80d8f55f0
Author: Dan Fandrich <address@hidden>
AuthorDate: Sat Apr 29 18:52:51 2017 +0200
url: fixed a memory leak on OOM while setting CURLOPT_BUFFERSIZE
---
lib/url.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/lib/url.c b/lib/url.c
index f5998d6b1..4fc2f4cad 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -2293,12 +2293,13 @@ CURLcode Curl_setopt(struct Curl_easy *data, CURLoption
option,
/* Resize only if larger than default buffer size. */
if(data->set.buffer_size > BUFSIZE) {
- data->state.buffer = realloc(data->state.buffer,
- data->set.buffer_size + 1);
- if(!data->state.buffer) {
+ char *newbuff = realloc(data->state.buffer, data->set.buffer_size + 1);
+ if(!newbuff) {
DEBUGF(fprintf(stderr, "Error: realloc of buffer failed\n"));
result = CURLE_OUT_OF_MEMORY;
}
+ else
+ data->state.buffer = newbuff;
}
break;
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 33/254: cookie_interface.c: changed the other domain to example.com too, (continued)
- [GNUnet-SVN] [gnurl] 33/254: cookie_interface.c: changed the other domain to example.com too, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 26/254: nss: load libnssckbi.so if no other trust is specified, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 29/254: http-proxy: remove unused argument from Curl_proxyCONNECT(), gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 36/254: tool_operate: use utimes instead of obsolescent utime when available, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 32/254: cookie_interface.c: fix cookie domain so the example works, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 87/254: test557: set a known good numeric locale, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 89/254: tests/server: make string literals const, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 37/254: runtests.pl: support multiline <postcheck> commands, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 75/254: curl: non-boolean command line args reject --no- prefixes, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 52/254: anyauthput: remove unused code, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 39/254: url: fixed a memory leak on OOM while setting CURLOPT_BUFFERSIZE,
gnunet <=
- [GNUnet-SVN] [gnurl] 108/254: test537: use correct variable type, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 103/254: buildconf: fix hang on IRIX, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 30/254: lib: remove unused code, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 102/254: opts: fix bad example formatting \n => \\n, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 86/254: curl: fix warning "comma at end of enumerator list", gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 61/254: failf: use private buffer, don't clobber receive buffer, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 92/254: runtests: use -R for random order, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 71/254: url: let CURLOPT_BUFFERSIZE realloc to smaller sizes too, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 42/254: unit1604: fixed compilation under Windows, broken in the previous commit, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 38/254: tests: added --remote-time tests for remaining protocols that support it, gnunet, 2017/06/17