Skip to content

Memory leak on multiple calls to loadCACert and others on WiFiClientSecure #5826

Closed
@sguarin

Description

@sguarin

If you have a system that can accept certs configuration, then multiple calls to loadCACert or related functions will not reutilize the memory assigned.

https://github.com/sguarin/arduino-esp32/blob/caa8d07aafa04441bb85e6046a795249c01d9e39/libraries/WiFiClientSecure/src/WiFiClientSecure.cpp#L304

_streamLoad()
allocates memory for new certificates. A better approach should be using realloc().

https://github.com/sguarin/arduino-esp32/blob/caa8d07aafa04441bb85e6046a795249c01d9e39/libraries/WiFiClientSecure/src/WiFiClientSecure.cpp#L290

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions