8000 Memory leak in log_printf (when printing exactly 64 characters plus trailing \0) · Issue #2232 · espressif/arduino-esp32 · GitHub
[go: up one dir, main page]

Skip to content
Memory leak in log_printf (when printing exactly 64 characters plus trailing \0) #2232
Closed
@felixstorm

Description

@felixstorm

Same problem as reported (and fixed) here: #2201

Buffer is being allocated if vsnprintf reports 64 or more characters (due to the trailing \0):

if(len >= sizeof(loc_buf)){
temp = (char*)malloc(len+1);

But the buffer is only being released if more than 64 characters had been reported by vsnprintf:
if(len > 64){
free(temp);

Probably related: #2033 (happens only when debug is on and free heap drops by 64 bytes each time)

Code to reproduce:

log_printf("1234567890123456789012345678901234567890123456789012345678901234");

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0