summaryrefslogtreecommitdiff
path: root/lib/setopt.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/setopt.c')
-rw-r--r--lib/setopt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/setopt.c b/lib/setopt.c
index 72704127c..2ddaeef7d 100644
--- a/lib/setopt.c
+++ b/lib/setopt.c
@@ -2076,7 +2076,7 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param)
arg = READBUFFER_MIN;
/* Resize if new size */
- if(arg != data->set.buffer_size) {
+ if((arg != data->set.buffer_size) && data->state.buffer) {
char *newbuff = realloc(data->state.buffer, arg + 1);
if(!newbuff) {
DEBUGF(fprintf(stderr, "Error: realloc of buffer failed\n"));