summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2018-03-13 00:51:39 +0100
committerDaniel Stenberg <daniel@haxx.se>2018-03-13 00:57:18 +0100
commit83f0ebfc6e09ef0c6777b594fecc1a77eb631070 (patch)
tree1b3c34f13512bf806dddf9f95f88f78e24e53a4d
parent98eee3396d7e225d74208cc13c21dce853b10082 (diff)
downloadcurl-83f0ebfc6e09ef0c6777b594fecc1a77eb631070.tar.gz
curl_multi_add_handle/easy_perform: clear errorbuffer if set
To offer applications a more defined behavior, we clear the buffer as early as possible. Bug #2190
-rw-r--r--lib/easy.c4
-rw-r--r--lib/multi.c2
2 files changed, 6 insertions, 0 deletions
diff --git a/lib/easy.c b/lib/easy.c
index 64c647be2..34c17c6b6 100644
--- a/lib/easy.c
+++ b/lib/easy.c
@@ -743,6 +743,10 @@ static CURLcode easy_perform(struct Curl_easy *data, bool events)
CURLcode result = CURLE_OK;
SIGPIPE_VARIABLE(pipe_st);
+ if(data->set.errorbuffer)
+ /* clear this as early as possible */
+ data->set.errorbuffer[0] = 0;
+
if(!data)
return CURLE_BAD_FUNCTION_ARGUMENT;
diff --git a/lib/multi.c b/lib/multi.c
index 98e5fca2a..671f4597e 100644
--- a/lib/multi.c
+++ b/lib/multi.c
@@ -378,6 +378,8 @@ CURLMcode curl_multi_add_handle(struct Curl_multi *multi,
* potential multi's connection cache growing which won't be undone in this
* function no matter what.
*/
+ if(data->set.errorbuffer)
+ data->set.errorbuffer[0] = 0;
/* set the easy handle */
multistate(data, CURLM_STATE_INIT);