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
@ -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…
Reference in New Issue
Block a user