Fix resource leak
authormayeut <mayeut@users.noreply.github.com>
Thu, 24 Sep 2015 22:39:05 +0000 (00:39 +0200)
committermayeut <mayeut@users.noreply.github.com>
Thu, 24 Sep 2015 22:39:05 +0000 (00:39 +0200)
src/bin/jp2/opj_decompress.c

index bd755c82d5d54c3577bc8be5612e98c087ce7b59..c27dc201849bbeee4509a76baa6a0d908de4584b 100644 (file)
@@ -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;       
 }