aboutsummaryrefslogtreecommitdiff
path: root/lib/sqfs
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-07-27 21:27:47 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-07-28 16:33:57 +0200
commitd07354def451e13c1757c871cd6213fba058dcc0 (patch)
tree63a215dbdf90b118389baae458f2bf7a3f7b287b /lib/sqfs
parent6c95b2041e8f0d107db2fab0391bff8ce637d01f (diff)
Fix free() of stack pointer in id_table_read error path
We didn't allocate the ID table, so we don't need to free() it when reading from disk fails. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfs')
-rw-r--r--lib/sqfs/id_table_read.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/sqfs/id_table_read.c b/lib/sqfs/id_table_read.c
index bed0cf4..0110082 100644
--- a/lib/sqfs/id_table_read.c
+++ b/lib/sqfs/id_table_read.c
@@ -28,10 +28,8 @@ int id_table_read(id_table_t *tbl, int fd, sqfs_super_t *super,
tbl->max_ids = super->id_count;
tbl->ids = sqfs_read_table(fd, cmp, tbl->num_ids * sizeof(uint32_t),
super->id_table_start);
- if (tbl->ids == NULL) {
- free(tbl);
+ if (tbl->ids == NULL)
return -1;
- }
for (i = 0; i < tbl->num_ids; ++i)
tbl->ids[i] = le32toh(tbl->ids[i]);