diff options
author | Richard Genoud <richard.genoud@posteo.net> | 2020-11-03 14:11:09 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2020-11-19 17:45:49 +0300 |
commit | 508a9dc7f694df11c7de7460f888f508e40a2046 (patch) | |
tree | 4ae83298124fa6a16cf7e457b795894fbf74ca8c /fs/squashfs | |
parent | dc3312c43c82ff9335b2bf4ee4f72365e824adfd (diff) | |
download | u-boot-508a9dc7f694df11c7de7460f888f508e40a2046.tar.xz |
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: Richard Genoud <richard.genoud@posteo.net>
Diffstat (limited to 'fs/squashfs')
-rw-r--r-- | fs/squashfs/sqfs.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c index 7da2e09cc3..3b008b5235 100644 --- a/fs/squashfs/sqfs.c +++ b/fs/squashfs/sqfs.c @@ -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)) { |