From: Daniel Stenberg Date: Sun, 30 Apr 2017 22:31:56 +0000 (+0200) Subject: url: let CURLOPT_BUFFERSIZE realloc to smaller sizes too X-Git-Tag: curl-7_54_1~182 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4858c451ee54d0104f68408debb3a32947b7b273;p=curl url: let CURLOPT_BUFFERSIZE realloc to smaller sizes too Closes #1449 --- diff --git a/lib/url.c b/lib/url.c index e018927c0..a2e8902f1 100644 --- a/lib/url.c +++ b/lib/url.c @@ -2298,8 +2298,8 @@ CURLcode Curl_setopt(struct Curl_easy *data, CURLoption option, else if(arg < READBUFFER_MIN) arg = READBUFFER_MIN; - /* Resize only if larger than default buffer size. */ - if(arg > READBUFFER_SIZE) { + /* Resize if new size */ + if(arg != data->set.buffer_size) { char *newbuff = realloc(data->state.buffer, arg + 1); if(!newbuff) { DEBUGF(fprintf(stderr, "Error: realloc of buffer failed\n"));