mirror of
https://github.com/curl/curl.git
synced 2026-08-25 02:53:32 +03:00
dynbuf: assert init on free
Add a DEBUGASSERT() in Curl_dyn_free() that checks that Curl_dyn_init() has been performed before. Fix code places that did it wrong. Fixes #16725 Closes #16775
This commit is contained in:
parent
cd7eb9e0f2
commit
646b2d6ca2
17 changed files with 222 additions and 163 deletions
|
|
@ -60,6 +60,7 @@ void Curl_dyn_init(struct dynbuf *s, size_t toobig)
|
|||
void Curl_dyn_free(struct dynbuf *s)
|
||||
{
|
||||
DEBUGASSERT(s);
|
||||
DEBUGASSERT(s->init == DYNINIT);
|
||||
Curl_safefree(s->bufr);
|
||||
s->leng = s->allc = 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue