Skip to content

Memory leakage problem in atc.c file #3

@ogulcan90

Description

@ogulcan90

Hi Nima,

In your atc.c file, atc_addSearch() function you are allocation memory as follows:

atc->search[atc->searchIndex] = (char*) atc_alloc(strlen(str) + 1);

However, you do not free the memory afterwards, thus, I believe this creates a memory leak, which leads a crush after some time. I'm using you gsm_v5 library that uses this library, so this problem affects it.

To solve this, I think you can put the following just before the "return true"
atc_free(atc->search[atc->searchIndex]);

Regards,
Ogulcan

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions