diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-07-27 21:27:47 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-07-28 16:33:57 +0200 |
commit | d07354def451e13c1757c871cd6213fba058dcc0 (patch) | |
tree | 63a215dbdf90b118389baae458f2bf7a3f7b287b /lib/sqfs/id_table_read.c | |
parent | 6c95b2041e8f0d107db2fab0391bff8ce637d01f (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/id_table_read.c')
-rw-r--r-- | lib/sqfs/id_table_read.c | 4 |
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]); |