mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-23 04:53:08 +00:00
Gui: fix memory leak in file browser module (#1848)
This commit is contained in:
parent
88ca267466
commit
c13929330e
1 changed files with 3 additions and 1 deletions
|
@ -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->path, src->path);
|
||||||
furi_string_set(obj->display_name, src->display_name);
|
furi_string_set(obj->display_name, src->display_name);
|
||||||
if(src->custom_icon_data) {
|
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);
|
memcpy(obj->custom_icon_data, src->custom_icon_data, CUSTOM_ICON_MAX_SIZE);
|
||||||
} else {
|
} else {
|
||||||
obj->custom_icon_data = NULL;
|
obj->custom_icon_data = NULL;
|
||||||
|
@ -379,6 +378,9 @@ static void
|
||||||
});
|
});
|
||||||
furi_string_free(item.display_name);
|
furi_string_free(item.display_name);
|
||||||
furi_string_free(item.path);
|
furi_string_free(item.path);
|
||||||
|
if(item.custom_icon_data) {
|
||||||
|
free(item.custom_icon_data);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
with_view_model(
|
with_view_model(
|
||||||
browser->view, (FileBrowserModel * model) {
|
browser->view, (FileBrowserModel * model) {
|
||||||
|
|
Loading…
Reference in a new issue