From fa9593a611a74a2b74ce6815ab5e50c8e7d265d1 Mon Sep 17 00:00:00 2001 From: Willy-JL <49810075+Willy-JL@users.noreply.github.com> Date: Tue, 25 Jun 2024 02:58:53 +0200 Subject: [PATCH] FindMy: Add missing string free (fix #150) --- applications/system/findmy/findmy_state.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/applications/system/findmy/findmy_state.c b/applications/system/findmy/findmy_state.c index ef6da5df8..047eb0b83 100644 --- a/applications/system/findmy/findmy_state.c +++ b/applications/system/findmy/findmy_state.c @@ -14,9 +14,9 @@ bool findmy_state_load(FindMyState* out_state) { Storage* storage = furi_record_open(RECORD_STORAGE); if(storage_file_exists(storage, FINDMY_STATE_PATH)) { FlipperFormat* file = flipper_format_file_alloc(storage); + FuriString* str = furi_string_alloc(); + uint32_t tmp; do { - uint32_t tmp; - FuriString* str = furi_string_alloc(); if(!flipper_format_file_open_existing(file, FINDMY_STATE_PATH)) break; if(!flipper_format_read_header(file, str, &tmp)) break; if(furi_string_cmp_str(str, FINDMY_STATE_HEADER)) break; @@ -50,6 +50,7 @@ bool findmy_state_load(FindMyState* out_state) { loaded_from_file = true; } while(0); + furi_string_free(str); flipper_format_free(file); } furi_record_close(RECORD_STORAGE);