mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-11-23 10:01:58 +03:00
Gui: fix memory leak in file browser module (#1848)
This commit is contained in:
parent
88ca267466
commit
c13929330e
@ -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;
|
||||
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user