summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fs/squashfs/sqfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c
index 1ac0762588..a9e803cbac 100644
--- a/fs/squashfs/sqfs.c
+++ b/fs/squashfs/sqfs.c
@@ -1341,7 +1341,6 @@ int sqfs_read(const char *filename, void *buf, loff_t offset, loff_t len,
if (ret) {
printf("File not found.\n");
*actread = 0;
- sqfs_closedir(dirsp);
ret = -ENOENT;
goto free_paths;
}
@@ -1532,6 +1531,7 @@ free_datablk:
free_paths:
free(file);
free(dir);
+ sqfs_closedir(dirsp);
return ret;
}