Fix resource leak
This commit is contained in:
parent
b9ca882749
commit
4da7e9617f
|
@ -361,6 +361,7 @@ int get_num_images(char *imgdirpath){
|
|||
continue;
|
||||
num_images++;
|
||||
}
|
||||
closedir(dir);
|
||||
return num_images;
|
||||
}
|
||||
|
||||
|
@ -387,6 +388,7 @@ int load_images(dircnt_t *dirptr, char *imgdirpath){
|
|||
strcpy(dirptr->filename[i],content->d_name);
|
||||
i++;
|
||||
}
|
||||
closedir(dir);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue