tar-util: clear xattrs and acls in open_inode_done()

Otherwise, if it is called multiple times for an object, then the
xattrs and acls may be freed multiple times.
This commit is contained in:
Yu Watanabe
2026-08-26 08:19:44 +09:00
parent 4d6cea8de6
commit 25d7cdc9f5
+6 -4
View File
@@ -79,12 +79,14 @@ static void open_inode_done(OpenInode *of) {
of->fd = safe_close(of->fd);
of->path = mfree(of->path);
}
xattr_free_array(of->xattr, of->n_xattr);
of->xattr = NULL;
of->n_xattr = 0;
#if HAVE_ACL
if (of->acl_access)
sym_acl_free(of->acl_access);
if (of->acl_default)
sym_acl_free(of->acl_default);
acl_freep(&of->acl_access);
acl_freep(&of->acl_default);
#endif
}