- status: open --> open-fixed
memory leak is found in the function
ekhtml_parser_destroy(). hnode_t is being deleted from
hash table without being freed.
replacing the call for hash_scan_delete() with a call for
hash_scan_delfree() solves this leak.
here is the fixed function:
void ekhtml_parser_destroy(ekhtml_parser_t *ekparser)
{
hnode_t *hn;
hscan_t hs;
hash_scan_begin(&hs, ekparser->startendcb);
while((hn = hash_scan_next(&hs)))
{
ekhtml_string_t *key =
(ekhtml_string_t *)hnode_getkey(hn);
ekhtml_tag_container *cont =
hnode_get(hn);
hash_scan_delfree(ekparser-
>startendcb, hn); // mem leak fix
free((char *)key->str);
free(key);
free(cont);
}
hash_destroy(ekparser->startendcb);
ekhtml_parser_starttag_cleanup(ekparser);
free(ekparser->buf);
free(ekparser);
}