Skip to content

memory resource leak via uncompressedSamples buffer in GPMF_ScaledData() #104

Description

@invd

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions