summaryrefslogtreecommitdiffstats
path: root/lib/loopdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/loopdev.c')
-rw-r--r--lib/loopdev.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/loopdev.c b/lib/loopdev.c
index 9eb21025f..8ba3d1089 100644
--- a/lib/loopdev.c
+++ b/lib/loopdev.c
@@ -427,6 +427,7 @@ static int loop_scandir(const char *dirname, int **ary, int hasprefix)
tmp = realloc(*ary, arylen * sizeof(int));
if (!tmp) {
free(*ary);
+ closedir(dir);
return -1;
}
*ary = tmp;