syoyo / tinyobjloader-c

Header only tiny wavefront .obj loader in pure C99

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Memory leak in tinyobj_parse_and_index_mtl_file

Snigelson opened this issue · comments

Memory is allocates for line_infos by get_line_infos, but the memory is never free'd.

Adding TINYOBJ_FREE(line_infos); at the end if the function solves this.

line_infos are freed at here:

TINYOBJ_FREE(line_infos);

but may be not free'ed in tinyobj_parse_and_index_mtl_file:

static int tinyobj_parse_and_index_mtl_file(tinyobj_material_t **materials_out,

You can send us PR!

Closed via #54