diff options
author | Richard Genoud | 2020-11-03 12:11:13 +0100 |
---|---|---|
committer | Tom Rini | 2020-11-19 09:45:49 -0500 |
commit | 7ce9745cbeae7733a7068f19a7fc3ec8f21dc38c (patch) | |
tree | 7d08dee7e06b3dea833780127232108e11238279 /fs | |
parent | b34949fe9baaae49003b2981213495bab3afef9b (diff) |
fs/squashfs: sqfs_read: fix memory leak
sqfs_closedir() should be called to free memory allocated by
sqfs_opendir()
Reviewed-by: Joao Marcos Costa <jmcosta944@gmail.com>
Signed-off-by: Richard Genoud <richard.genoud@posteo.net>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/squashfs/sqfs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c index 1ac07625889..a9e803cbac2 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; } |