mirror of
https://github.com/curl/curl.git
synced 2026-08-24 19:53:46 +03:00
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:
parent
d9ccc75b00
commit
d36c632c86
2 changed files with 9 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue