Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak in tinyobj_parse_and_index_mtl_file #49

Closed
Snigelson opened this issue Sep 28, 2021 · 2 comments
Closed

Memory leak in tinyobj_parse_and_index_mtl_file #49

Snigelson opened this issue Sep 28, 2021 · 2 comments
Labels

Comments

@Snigelson
Copy link

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.

@syoyo
Copy link
Owner

syoyo commented Sep 28, 2021

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!

@syoyo syoyo added the bug label Sep 30, 2021
@syoyo
Copy link
Owner

syoyo commented Nov 14, 2022

Closed via #54

@syoyo syoyo closed this as completed Nov 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants