From 3212a773d1bc1431cbe72cbb769fd7d4f57c1b5a Mon Sep 17 00:00:00 2001 From: David Lee Date: Fri, 19 Jul 2024 10:51:02 +0200 Subject: [PATCH] Furi String free in storage if things fail --- README.md | 1 + application.fam | 2 +- boilerplate.h | 2 +- docs/changelog.md | 3 +++ helpers/boilerplate_storage.c | 2 ++ 5 files changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7b131f69668..0fab0e59ebb 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,7 @@ This code is open-source and may be used for whatever you want to do with it. - [Flipc](flipc.org) for distributing the boilerplate - [Nikita Vostokov](https://github.com/wosk) for code contributions - [Alexander Rodriguez](https://github.com/squee72564) for code contributions +- [derskythe](https://github.com/derskythe) for code contributions ## Some cool projects I found using this (love seeing it being used. Let me know if you want yours added)
diff --git a/application.fam b/application.fam index 42c419c6905..061807d8a00 100644 --- a/application.fam +++ b/application.fam @@ -13,5 +13,5 @@ App( fap_icon="icons/boilerplate_10px.png", fap_icon_assets="icons", fap_category="Misc", - fap_version="1.1", + fap_version="1.2", ) \ No newline at end of file diff --git a/boilerplate.h b/boilerplate.h index ed48a826e4b..de5b2d858ab 100644 --- a/boilerplate.h +++ b/boilerplate.h @@ -24,7 +24,7 @@ #define SUBGHZ_APP_EXTENSION ".sub" #define SUBGHZ_APP_FOLDER ANY_PATH("subghz") -#define BOILERPLATE_VERSION "1.1" +#define BOILERPLATE_VERSION "1.2" typedef struct { Gui* gui; diff --git a/docs/changelog.md b/docs/changelog.md index 20357479756..a4774acf998 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,3 +1,6 @@ +## 1.2 +- Added fixed to clear furi_string on storage if things fail (found by derskythe) + ## 1.1 - Add Version to Startscreen - Fixed crash after furi_check on fw 0.100.3 diff --git a/helpers/boilerplate_storage.c b/helpers/boilerplate_storage.c index 8f9304e415c..d2832bb06ee 100644 --- a/helpers/boilerplate_storage.c +++ b/helpers/boilerplate_storage.c @@ -86,6 +86,7 @@ void boilerplate_read_settings(void* context) { FURI_LOG_E(TAG, "Cannot open file %s", BOILERPLATE_SETTINGS_SAVE_PATH); boilerplate_close_config_file(fff_file); boilerplate_close_storage(); + furi_string_free(temp_str); return; } @@ -93,6 +94,7 @@ void boilerplate_read_settings(void* context) { FURI_LOG_E(TAG, "Missing Header Data"); boilerplate_close_config_file(fff_file); boilerplate_close_storage(); + furi_string_free(temp_str); return; }