Commit 508a9dc7 authored by Richard Genoud's avatar Richard Genoud Committed by Tom Rini
Browse files

fs/squashfs: sqfs_size: fix dangling pointer dirs->entry



dirs->entry shouldn't be left dangling as it could be freed twice.
Signed-off-by: default avatarRichard Genoud <richard.genoud@posteo.net>
parent dc3312c4
......@@ -1569,6 +1569,7 @@ int sqfs_size(const char *filename, loff_t *size)
if (!ret)
break;
free(dirs->entry);
dirs->entry = NULL;
}
if (ret) {
......@@ -1582,6 +1583,7 @@ int sqfs_size(const char *filename, loff_t *size)
ipos = sqfs_find_inode(dirs->inode_table, i_number, sblk->inodes,
sblk->block_size);
free(dirs->entry);
dirs->entry = NULL;
base = (struct squashfs_base_inode *)ipos;
switch (get_unaligned_le16(&base->inode_type)) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment