folder_select prevent directory handle leak on error
Change-Id: If1617dc92683d7de3d7709b363a593e40fbc5bc8
This commit is contained in:
parent
429eedf49e
commit
93c9d675af
1 changed files with 3 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue