noproto / FlipperMfkey

MFKey for the Flipper Zero 🐬
GNU General Public License v3.0
227 stars 7 forks source link

Investigate possible memory leak in buffered_file_stream_alloc #6

Open noproto opened 1 year ago

noproto commented 1 year ago
    furi_delay_ms(5000); // run log
    Storage* storage = furi_record_open(RECORD_STORAGE);

    for(uint32_t i = 0; i < 1024; i++) {
        Stream* file_stream = buffered_file_stream_alloc(storage);
        buffered_file_stream_close(file_stream);
        free(file_stream);
        FURI_LOG_E("Bench", "Running %lu, still fine...", i); // will crash after ~100 runs
    }

    furi_record_close(RECORD_STORAGE);
noproto commented 11 months ago

Possibly missing stream_free instead of regular free.