DYNBUF.md: note Curl_dyn_add* calls Curl_dyn_free on failure

This is the existing behavior and it has been widely assumed in the
codebase.

Closes https://github.com/curl/curl/pull/10645
This commit is contained in:
Jay Satiro 2023-02-28 22:45:28 -05:00
parent d9ccc75b00
commit d36c632c86
2 changed files with 9 additions and 2 deletions

View file

@ -99,8 +99,7 @@ static CURLcode dyn_nappend(struct dynbuf *s,
include that as well when it uses this code */
void *p = realloc(s->bufr, a);
if(!p) {
Curl_safefree(s->bufr);
s->leng = s->allc = 0;
Curl_dyn_free(s);
return CURLE_OUT_OF_MEMORY;
}
s->bufr = p;