Skip to content

Commit 27a3b2a

Browse files
committed
fix: prevent fd leak in TraversalType2 implementation
1 parent f8f106b commit 27a3b2a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/libappimage/core/impl/TraversalType2.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ class TraversalType2::Priv {
5252
rootInodeId = sqfs_inode_root(&fs);
5353
err = sqfs_traverse_open(&trv, &fs, rootInodeId);
5454
if (err != SQFS_OK) {
55+
sqfs_fd_close(fs.fd);
5556
sqfs_destroy(&fs);
5657
throw IOError("sqfs_traverse_open error");
5758
}
@@ -60,6 +61,7 @@ class TraversalType2::Priv {
6061
virtual ~Priv() {
6162
sqfs_traverse_close(&trv);
6263

64+
sqfs_fd_close(fs.fd);
6365
sqfs_destroy(&fs);
6466
}
6567

0 commit comments

Comments
 (0)