dynbuf: Fix returncode on memory error

Curl_dyn_vaddf should return a proper error code in case allocating
memory failed.

Closes: #13533
Author: Christian Schmitz <support@monkeybreadsoftware.de>
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
This commit is contained in:
Christian Schmitz 2024-05-04 11:44:02 +02:00 committed by Daniel Gustafsson
parent b8435242ba
commit 62e45ce9cd

View file

@ -213,7 +213,7 @@ CURLcode Curl_dyn_vaddf(struct dynbuf *s, const char *fmt, va_list ap)
}
/* If we failed, we cleanup the whole buffer and return error */
Curl_dyn_free(s);
return CURLE_OK;
return CURLE_OUT_OF_MEMORY;
#endif
}