[PATCH 13/17] fs/squashfs: sqfs_read: fix dangling pointer dirs->entry

Richard Genoud
2020-10-14T08:06:18Z

dirs->entry shouldn't be left dangling as it could be freed twice.

Signed-off-by: Richard Genoud <richard.genoud@posteo.net>
---
fs/squashfs/sqfs.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c
index 116b5160ee3..0510ae311d1 100644
--- a/fs/squashfs/sqfs.c
+++ b/fs/squashfs/sqfs.c
@@ -1335,6 +1335,7 @@ int sqfs_read(const char *filename, void *buf, loff_t offset, loff_t len,
break;

free(dirs->entry);
+ dirs->entry = NULL;
}

if (ret) {