
3 Nov
2020
3 Nov
'20
12:11 p.m.
This will prevent a double free error if sqfs_close() is called twice.
Signed-off-by: Richard Genoud richard.genoud@posteo.net --- fs/squashfs/sqfs.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c index 7d6f0e88e31..a46e19c75c5 100644 --- a/fs/squashfs/sqfs.c +++ b/fs/squashfs/sqfs.c @@ -49,6 +49,7 @@ static int sqfs_read_sblk(struct squashfs_super_block **sblk)
if (sqfs_disk_read(0, 1, *sblk) != 1) { free(*sblk); + sblk = NULL; return -EINVAL; }
@@ -1638,6 +1639,7 @@ free_strings: void sqfs_close(void) { free(ctxt.sblk); + ctxt.sblk = NULL; ctxt.cur_dev = NULL; sqfs_decompressor_cleanup(&ctxt); }