mirror of
https://github.com/curl/curl.git
synced 2026-04-14 21:41:41 +03:00
hash: add asserts in hash_element_dtor()
This just adds a precaution and shows a clear intention in the code. Added because CodeSonar is reporting a false positive Use After Free on this function. Closes #15889
This commit is contained in:
parent
7fed7274e4
commit
7fb113f01f
1 changed files with 2 additions and 0 deletions
|
|
@ -42,6 +42,8 @@ hash_element_dtor(void *user, void *element)
|
|||
{
|
||||
struct Curl_hash *h = (struct Curl_hash *) user;
|
||||
struct Curl_hash_element *e = (struct Curl_hash_element *) element;
|
||||
DEBUGASSERT(h);
|
||||
DEBUGASSERT(e);
|
||||
|
||||
if(e->ptr) {
|
||||
if(e->dtor)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue