Message ID | 20201103111126.23600-16-richard.genoud@posteo.net |
---|---|
State | Accepted |
Commit | 7ce9745cbeae7733a7068f19a7fc3ec8f21dc38c |
Delegated to: | Tom Rini |
Headers | show |
Series | fs/squashfs: fix memory leaks and introduce exists() function | expand |
Reviewed-by Joao Marcos Costa <jmcosta944@gmail.com> Em ter., 3 de nov. de 2020 às 08:12, Richard Genoud < richard.genoud@posteo.net> escreveu: > sqfs_closedir() should be called to free memory allocated by > sqfs_opendir() > > Signed-off-by: Richard Genoud <richard.genoud@posteo.net> > --- > fs/squashfs/sqfs.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > 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; > } >
On Tue, Nov 03, 2020 at 12:11:13PM +0100, Richard Genoud wrote: > 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> Applied to u-boot/master, thanks!
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; }
sqfs_closedir() should be called to free memory allocated by sqfs_opendir() Signed-off-by: Richard Genoud <richard.genoud@posteo.net> --- fs/squashfs/sqfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)