From 80005b4c8a5743aa48f6164f5da602cd8416451d Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 18 Nov 2025 15:00:50 +0100 Subject: [PATCH] cookie: return error on OOM Follow-up to 3f0629ca443825916cbc0795bcd5f241fbf710 Closes #19591 --- lib/cookie.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/cookie.c b/lib/cookie.c index c7dedc95e8..85356d563b 100644 --- a/lib/cookie.c +++ b/lib/cookie.c @@ -464,10 +464,11 @@ parse_cookie_header(struct Curl_easy *data, return CURLE_OK; strstore(&co->name, curlx_str(&name), curlx_strlen(&name)); - strstore(&co->value, curlx_str(&val), curlx_strlen(&val)); - done = TRUE; + if(co->name) + strstore(&co->value, curlx_str(&val), curlx_strlen(&val)); if(!co->name || !co->value) - return CURLE_OK; + return CURLE_OUT_OF_MEMORY; + done = TRUE; if(invalid_octets(co->value) || invalid_octets(co->name)) { infof(data, "invalid octets in name/value, cookie dropped");