mirror of
https://github.com/curl/curl.git
synced 2025-01-06 13:44:52 +08:00
tool_operate: fix a scan-build warning
... and avoid the temp storing of the return code in a diff variable. Closes #8565
This commit is contained in:
parent
3e842078f3
commit
bec62e39d1
@ -1736,20 +1736,17 @@ static CURLcode single_transfer(struct GlobalConfig *global,
|
|||||||
if(config->cookies) {
|
if(config->cookies) {
|
||||||
struct curlx_dynbuf cookies;
|
struct curlx_dynbuf cookies;
|
||||||
struct curl_slist *cl;
|
struct curl_slist *cl;
|
||||||
CURLcode ret;
|
|
||||||
|
|
||||||
/* The maximum size needs to match MAX_NAME in cookie.h */
|
/* The maximum size needs to match MAX_NAME in cookie.h */
|
||||||
curlx_dyn_init(&cookies, 4096);
|
curlx_dyn_init(&cookies, 4096);
|
||||||
for(cl = config->cookies; cl; cl = cl->next) {
|
for(cl = config->cookies; cl; cl = cl->next) {
|
||||||
if(cl == config->cookies)
|
if(cl == config->cookies)
|
||||||
ret = curlx_dyn_addf(&cookies, "%s", cl->data);
|
result = curlx_dyn_addf(&cookies, "%s", cl->data);
|
||||||
else
|
else
|
||||||
ret = curlx_dyn_addf(&cookies, ";%s", cl->data);
|
result = curlx_dyn_addf(&cookies, ";%s", cl->data);
|
||||||
|
|
||||||
if(ret) {
|
if(result)
|
||||||
result = CURLE_OUT_OF_MEMORY;
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
my_setopt_str(curl, CURLOPT_COOKIE, curlx_dyn_ptr(&cookies));
|
my_setopt_str(curl, CURLOPT_COOKIE, curlx_dyn_ptr(&cookies));
|
||||||
|
Loading…
Reference in New Issue
Block a user