summaryrefslogtreecommitdiff
path: root/lib/sqfshelper/serialize_fstree.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-10-06 19:25:12 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-10-06 19:25:12 +0200
commit7fb91aa5872a79ab94a9adae6ca72f1b1d0f8e36 (patch)
treee5091822a0b5a3b4a585c5ba19f99853f23b003f /lib/sqfshelper/serialize_fstree.c
parent41ddda0c732d916a6962c54a3a974a8b753f194b (diff)
Fix resource leaks reported by coverity
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfshelper/serialize_fstree.c')
-rw-r--r--lib/sqfshelper/serialize_fstree.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/sqfshelper/serialize_fstree.c b/lib/sqfshelper/serialize_fstree.c
index 05a9d3a..c2d956f 100644
--- a/lib/sqfshelper/serialize_fstree.c
+++ b/lib/sqfshelper/serialize_fstree.c
@@ -175,13 +175,17 @@ int sqfs_serialize_fstree(const char *filename, sqfs_file_t *file,
ret = sqfs_id_table_id_to_index(idtbl, n->uid,
&inode->base.uid_idx);
- if (ret)
+ if (ret) {
+ free(inode);
goto out;
+ }
ret = sqfs_id_table_id_to_index(idtbl, n->gid,
&inode->base.gid_idx);
- if (ret)
+ if (ret) {
+ free(inode);
goto out;
+ }
sqfs_meta_writer_get_position(im, &block, &offset);
fs->inode_table[i]->inode_ref = (block << 16) | offset;