summaryrefslogtreecommitdiffstats
path: root/apps/gui/folder_select.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui/folder_select.c')
-rw-r--r--apps/gui/folder_select.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/apps/gui/folder_select.c b/apps/gui/folder_select.c
index f2830fb8fd..706b166941 100644
--- a/apps/gui/folder_select.c
+++ b/apps/gui/folder_select.c
@@ -165,7 +165,10 @@ static struct folder* load_folder(struct folder* parent, char *folder)
}
char *name = folder_alloc_from_end(len+1);
if (!name)
+ {
+ closedir(dir);
return NULL;
+ }
memcpy(name, (char *)entry->d_name, len+1);
child_count++;
first_child = name;