Skip to content

leaking memory #7

@homonto

Description

@homonto

hi,
this line:

char *payloadhex = utils.buildHexData(nullptr, payload, payloadlen);

leaks memory because it is missing free:

free(payloadhex);

after some time esp32 gets 0 bytes free memory (depends how often you call this function).

problem is that: char* BLEUtils::buildHexData(); does not free the memory so once you call it, you need to free manually before next loop/call/whatever

and onResult() is repeated all the time you receive data so after some time you get restart of esp32 once no more memory left

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