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 resource leak via uncompressedSamples buffer in GPMF_ScaledData() #104

Closed
invd opened this issue Jul 14, 2020 · 1 comment
Closed

Comments

@invd
Copy link

invd commented Jul 14, 2020

uncompressedSamples is allocated here:

uncompressedSamples = (uint32_t *)malloc(neededunc + 12);

The free() is supposed to happen during the cleanup:

gpmf-parser/GPMF_parser.c

Lines 1702 to 1704 in 2cc0af7

cleanup:
if(uncompressedSamples)
free(uncompressedSamples);

However, a lot of code paths in this function directly call return instead of assigning ret and jumping to cleanup, which leaks the memory ressources of uncompressedSamples.

Similar to #103, this is likely not a significant problem for short program runs, but it can become a limiting factor for long-running processes.

@dnewman-gpsw
Copy link
Collaborator

Good find. Fixed on the develop branch. Moving to master shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants