Skip to content

Commit

Permalink
Gui: fix memory leak in file browser module (#1848)
Browse files Browse the repository at this point in the history
  • Loading branch information
skotopes authored Oct 8, 2022
1 parent 88ca267 commit c139293
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion applications/services/gui/modules/file_browser.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ static void BrowserItem_t_set(BrowserItem_t* obj, const BrowserItem_t* src) {
furi_string_set(obj->path, src->path);
furi_string_set(obj->display_name, src->display_name);
if(src->custom_icon_data) {
obj->custom_icon_data = malloc(CUSTOM_ICON_MAX_SIZE);
memcpy(obj->custom_icon_data, src->custom_icon_data, CUSTOM_ICON_MAX_SIZE);
} else {
obj->custom_icon_data = NULL;
Expand Down Expand Up @@ -379,6 +378,9 @@ static void
});
furi_string_free(item.display_name);
furi_string_free(item.path);
if(item.custom_icon_data) {
free(item.custom_icon_data);
}
} else {
with_view_model(
browser->view, (FileBrowserModel * model) {
Expand Down

0 comments on commit c139293

Please sign in to comment.