From 0e1b3f2d84c39251519e12a446dbdede3a43b31f Mon Sep 17 00:00:00 2001 From: Willy-JL <49810075+Willy-JL@users.noreply.github.com> Date: Tue, 11 Jul 2023 03:49:51 +0200 Subject: [PATCH] Fix NFC Maker buffer free --- .../nfc_maker/scenes/nfc_maker_scene_result.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/applications/external/nfc_maker/scenes/nfc_maker_scene_result.c b/applications/external/nfc_maker/scenes/nfc_maker_scene_result.c index 64aa9db1a..38ad1e634 100644 --- a/applications/external/nfc_maker/scenes/nfc_maker_scene_result.c +++ b/applications/external/nfc_maker/scenes/nfc_maker_scene_result.c @@ -18,13 +18,13 @@ void nfc_maker_scene_result_on_enter(void* context) { FlipperFormat* file = flipper_format_file_alloc(furi_record_open(RECORD_STORAGE)); FuriString* path = furi_string_alloc(); furi_string_printf(path, NFC_APP_FOLDER "/%s" NFC_APP_EXTENSION, app->name_buf); + + uint32_t pages = 135; + size_t size = pages * 4; + uint8_t* buf = malloc(size); do { if(!flipper_format_file_open_new(file, furi_string_get_cstr(path))) break; - uint32_t pages = 135; - size_t size = pages * 4; - uint8_t* buf = malloc(size); - if(!flipper_format_write_header_cstr(file, "Flipper NFC device", 3)) break; if(!flipper_format_write_string_cstr(file, "Device type", "NTAG215")) break; @@ -330,10 +330,11 @@ void nfc_maker_scene_result_on_enter(void* context) { } if(!ok) break; - free(buf); success = true; } while(false); + free(buf); + furi_string_free(path); flipper_format_free(file); furi_record_close(RECORD_STORAGE);