lib: avoid assigning 'result' temporarily

Closes #15122
This commit is contained in:
Daniel Stenberg 2024-10-02 11:45:19 +02:00
parent 23386872d1
commit b5d453effa
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
5 changed files with 40 additions and 62 deletions

View file

@ -1974,11 +1974,8 @@ static CURLcode set_reader(struct Curl_easy *data, Curl_HttpReq httpreq)
switch(httpreq) {
case HTTPREQ_PUT: /* Let's PUT the data to the server! */
if(!postsize)
result = Curl_creader_set_null(data);
else
result = Curl_creader_set_fread(data, postsize);
return result;
return postsize ? Curl_creader_set_fread(data, postsize) :
Curl_creader_set_null(data);
#if !defined(CURL_DISABLE_MIME) || !defined(CURL_DISABLE_FORM_API)
case HTTPREQ_POST_FORM: