[ekhtml-devel] [ ekhtml-Bugs-969551 ] memory leak in ekhtml_parser_destroy()
Brought to you by:
jick
|
From: SourceForge.net <no...@so...> - 2004-06-09 12:21:42
|
Bugs item #969551, was opened at 2004-06-09 15:21 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=500165&aid=969551&group_id=62314 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Osnat (osnat) Assigned to: Nobody/Anonymous (nobody) Summary: memory leak in ekhtml_parser_destroy() Initial Comment: 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); } ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=500165&aid=969551&group_id=62314 |