aboutsummaryrefslogtreecommitdiff
path: root/lib/sqfs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqfs')
-rw-r--r--lib/sqfs/deserialize_fstree.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/sqfs/deserialize_fstree.c b/lib/sqfs/deserialize_fstree.c
index 8ed6314..46e58e0 100644
--- a/lib/sqfs/deserialize_fstree.c
+++ b/lib/sqfs/deserialize_fstree.c
@@ -62,8 +62,10 @@ static int fill_dir(meta_reader_t *ir, meta_reader_t *dr, tree_node_t *root,
return -1;
diff = sizeof(*ent) + strlen((char *)ent->name);
- if (diff > size)
+ if (diff > size) {
+ free(ent);
break;
+ }
size -= diff;
if (should_skip(ent->type, flags)) {