From: Daniel Stenberg Date: Mon, 13 May 2024 15:31:44 +0000 (+0200) Subject: setopt: acknowledge errors proper for CURLOPT_COOKIEJAR X-Git-Tag: curl-8_8_0~66 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9d6d614264b5f453954257d39cc3b87c414358df;p=thirdparty%2Fcurl.git setopt: acknowledge errors proper for CURLOPT_COOKIEJAR Error out on error, do not continue. Closes #13624 --- diff --git a/lib/setopt.c b/lib/setopt.c index 08100411cd..e8b25454b2 100644 --- a/lib/setopt.c +++ b/lib/setopt.c @@ -779,22 +779,20 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) /* * Set cookie file name to dump all cookies to when we're done. */ - { - struct CookieInfo *newcookies; result = Curl_setstropt(&data->set.str[STRING_COOKIEJAR], va_arg(param, char *)); - - /* - * Activate the cookie parser. This may or may not already - * have been made. - */ - newcookies = Curl_cookie_init(data, NULL, data->cookies, - data->set.cookiesession); - if(!newcookies) - result = CURLE_OUT_OF_MEMORY; - data->cookies = newcookies; - } - break; + if(!result) { + /* + * Activate the cookie parser. This may or may not already + * have been made. + */ + struct CookieInfo *newcookies = + Curl_cookie_init(data, NULL, data->cookies, data->set.cookiesession); + if(!newcookies) + result = CURLE_OUT_OF_MEMORY; + data->cookies = newcookies; + } + break; case CURLOPT_COOKIESESSION: /*