]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
dynbuf: Fix returncode on memory error
authorChristian Schmitz <support@monkeybreadsoftware.de>
Sat, 4 May 2024 09:44:02 +0000 (11:44 +0200)
committerDaniel Gustafsson <daniel@yesql.se>
Sat, 4 May 2024 09:44:27 +0000 (11:44 +0200)
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>
lib/dynbuf.c

index a4c599d10c78c3924c5f3eacee838ca89df4b059..3b62eaf8a4b5011b6e510ddc4a9ba55d8aefdd6c 100644 (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
 }