mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-06-19 21:21:25 +00:00
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>
This commit is contained in:
parent
b34949fe9b
commit
7ce9745cbe
1 changed files with 1 additions and 1 deletions
|
@ -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:
|
||||||
free_paths:
|
free_paths:
|
||||||
free(file);
|
free(file);
|
||||||
free(dir);
|
free(dir);
|
||||||
|
sqfs_closedir(dirsp);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue