bundle: fix memory leak spotted by EricV
This commit is contained in:
parent
de0562cbf8
commit
6df4ddba8e
1 changed files with 1 additions and 2 deletions
|
@ -313,8 +313,7 @@ int fb_scandir ( const char *path, fb_dirent ***list )
|
|||
|
||||
/* Direct */
|
||||
if (dir->type == FB_DIRECT) {
|
||||
if ((ret = scandir(dir->d.root, &de, NULL, NULL)) != -1) {
|
||||
if (ret == 0) return 0;
|
||||
if ((ret = scandir(dir->d.root, &de, NULL, NULL)) > 0) {
|
||||
*list = malloc(sizeof(fb_dirent*)*ret);
|
||||
for (i = 0; i < ret; i++) {
|
||||
(*list)[i] = calloc(1, sizeof(fb_dirent));
|
||||
|
|
Loading…
Add table
Reference in a new issue