Memory leak in function [on_dom_text_content](https://github.com/gpac/gpac/blob/941a0891b989f5ad86b739cfb12c84b7e62e8ee4/src/utils/xml_parser.c#L1757).
The memory leak is reported by a static analyzer tool developed at CAST (https://www.linkedin.com/company/cast-center).

Specifically, dynamic memories are allocated [here](https://github.com/gpac/gpac/blob/941a0891b989f5ad86b739cfb12c84b7e62e8ee4/src/utils/xml_parser.c#L1766) and [here](https://github.com/gpac/gpac/blob/941a0891b989f5ad86b739cfb12c84b7e62e8ee4/src/utils/xml_parser.c#L1773) if gf_list_add fails to add node [here](https://github.com/gpac/gpac/blob/941a0891b989f5ad86b739cfb12c84b7e62e8ee4/src/utils/xml_parser.c#L1774C29-L1774C33), allocated memories remain not freed. There are similar cases in other functions which use gf_list_add.

gf_isom_iff_create_image_item_from_track_internal
gf_text_import_sub_bifs
subs_box_read
iloc_box_read
gf_cfg_set_key_internal
dasher_period_count
httpout_process_event
gf_isom_add_subsample_info
jsf_pid_new_packet
svg_udom_set_float_trait
dasher_setup_rep
on_dom_node_start
Memory leak in function on_dom_text_content
This is a GitHub Issue
repo:gpac
owner:gpac
Title : Memory leak in function on_dom_text_content
Issue date:

--- start body ---
Memory leak in function [on_dom_text_content](https://github.com/gpac/gpac/blob/941a0891b989f5ad86b739cfb12c84b7e62e8ee4/src/utils/xml_parser.c#L1757).
The memory leak is reported by a static analyzer tool developed at CAST (https://www.linkedin.com/company/cast-center).

Specifically, dynamic memories are allocated [here](https://github.com/gpac/gpac/blob/941a0891b989f5ad86b739cfb12c84b7e62e8ee4/src/utils/xml_parser.c#L1766) and [here](https://github.com/gpac/gpac/blob/941a0891b989f5ad86b739cfb12c84b7e62e8ee4/src/utils/xml_parser.c#L1773) if gf_list_add fails to add node [here](https://github.com/gpac/gpac/blob/941a0891b989f5ad86b739cfb12c84b7e62e8ee4/src/utils/xml_parser.c#L1774C29-L1774C33), allocated memories remain not freed. There are similar cases in other functions which use gf_list_add.

gf_isom_iff_create_image_item_from_track_internal
gf_text_import_sub_bifs
subs_box_read
iloc_box_read
gf_cfg_set_key_internal
dasher_period_count
httpout_process_event
gf_isom_add_subsample_info
jsf_pid_new_packet
svg_udom_set_float_trait
dasher_setup_rep
on_dom_node_start
--- end body ---
