filebundle: fix wrong malloc() in fb_scandir() - coverity

This commit is contained in:
Jaroslav Kysela 2014-10-03 15:52:02 +02:00
parent 0b991efe32
commit 6daddcc761

View file

@ -344,7 +344,7 @@ int fb_scandir ( const char *path, fb_dirent ***list )
const filebundle_entry_t *fb;
ret = dir->b.root->d.count;
fb = dir->b.root->d.child;
*list = malloc(ret * sizeof(fb_dirent));
*list = malloc(ret * sizeof(fb_dirent*));
i = 0;
while (fb) {
(*list)[i] = calloc(1, sizeof(fb_dirent));