From 4da7e9617fd28bee0b8c7509a00759ca9da6fb32 Mon Sep 17 00:00:00 2001 From: mayeut Date: Fri, 25 Sep 2015 00:39:05 +0200 Subject: [PATCH] Fix resource leak --- src/bin/jp2/opj_decompress.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/bin/jp2/opj_decompress.c b/src/bin/jp2/opj_decompress.c index bd755c82..c27dc201 100644 --- a/src/bin/jp2/opj_decompress.c +++ b/src/bin/jp2/opj_decompress.c @@ -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; }