fs/squashfs: fix sqfs_read_sblk()
Setting sblk = NULL has no effect on the caller. We want to set *sblk = NULL if an error occurrs to avoid usage after free. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
This commit is contained in:
parent
89ab1e2817
commit
84378d5c86
@ -49,7 +49,7 @@ static int sqfs_read_sblk(struct squashfs_super_block **sblk)
|
|||||||
|
|
||||||
if (sqfs_disk_read(0, 1, *sblk) != 1) {
|
if (sqfs_disk_read(0, 1, *sblk) != 1) {
|
||||||
free(*sblk);
|
free(*sblk);
|
||||||
sblk = NULL;
|
*sblk = NULL;
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user