Skip to content

Commit

Permalink
add free's in case of return
Browse files Browse the repository at this point in the history
  • Loading branch information
xMasterX committed Jan 11, 2024
1 parent 3ccfd66 commit 96cb4c0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion non_catalog_apps/meal_pager/helpers/meal_pager_storage.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,20 +163,23 @@ void meal_pager_read_settings(void* context) {
FURI_LOG_E(TAG, "Cannot open file %s", MEAL_PAGER_SETTINGS_SAVE_PATH);
meal_pager_close_config_file(fff_file);
meal_pager_close_storage();
furi_string_free(temp_str);
return;
}

if(!flipper_format_read_header(fff_file, temp_str, &file_version)) {
FURI_LOG_E(TAG, "Missing Header Data");
meal_pager_close_config_file(fff_file);
meal_pager_close_storage();
furi_string_free(temp_str);
return;
}

if(file_version < MEAL_PAGER_SETTINGS_FILE_VERSION) {
FURI_LOG_I(TAG, "old config version, will be removed.");
meal_pager_close_config_file(fff_file);
meal_pager_close_storage();
furi_string_free(temp_str);
return;
}

Expand All @@ -199,7 +202,7 @@ void meal_pager_read_settings(void* context) {
flipper_format_rewind(fff_file);

furi_string_free(temp_str);

meal_pager_close_config_file(fff_file);
meal_pager_close_storage();
}
Expand Down

0 comments on commit 96cb4c0

Please sign in to comment.