]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
fs/squashfs: sqfs_read: fix another memory leak
authorRichard Genoud <richard.genoud@posteo.net>
Tue, 3 Nov 2020 11:11:14 +0000 (12:11 +0100)
committerTom Rini <trini@konsulko.com>
Thu, 19 Nov 2020 14:45:49 +0000 (09:45 -0500)
data_buffer was allocated in a loop and freed only once.

Signed-off-by: Richard Genoud <richard.genoud@posteo.net>
fs/squashfs/sqfs.c

index a9e803cbac2afb1fb613263596da0256ff93307a..cfea313e34b9356df6855101dbdbd3b1647799fd 100644 (file)
@@ -1459,6 +1459,8 @@ int sqfs_read(const char *filename, void *buf, loff_t offset, loff_t len,
                }
 
                data_offset += table_size;
+               free(data_buffer);
+               data_buffer = NULL;
        }
 
        free(finfo.blk_sizes);