Commit 7ce9745c authored by Richard Genoud's avatar Richard Genoud Committed by Tom Rini
Browse files

fs/squashfs: sqfs_read: fix memory leak



sqfs_closedir() should be called to free memory allocated by
sqfs_opendir()
Reviewed-by: default avatarJoao Marcos Costa <jmcosta944@gmail.com>
Signed-off-by: default avatarRichard Genoud <richard.genoud@posteo.net>
parent b34949fe
...@@ -1341,7 +1341,6 @@ int sqfs_read(const char *filename, void *buf, loff_t offset, loff_t len, ...@@ -1341,7 +1341,6 @@ int sqfs_read(const char *filename, void *buf, loff_t offset, loff_t len,
if (ret) { if (ret) {
printf("File not found.\n"); printf("File not found.\n");
*actread = 0; *actread = 0;
sqfs_closedir(dirsp);
ret = -ENOENT; ret = -ENOENT;
goto free_paths; goto free_paths;
} }
...@@ -1532,6 +1531,7 @@ free_datablk: ...@@ -1532,6 +1531,7 @@ free_datablk:
free_paths: free_paths:
free(file); free(file);
free(dir); free(dir);
sqfs_closedir(dirsp);
return ret; return ret;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment