From 25d7cdc9f5eaf4ebd44d7e71dd7d1f1c4d603f78 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Wed, 26 Aug 2026 05:48:22 +0900 Subject: [PATCH] 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. --- src/shared/tar-util.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/shared/tar-util.c b/src/shared/tar-util.c index c60054b2d1..6e3c065141 100644 --- a/src/shared/tar-util.c +++ b/src/shared/tar-util.c @@ -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 }