mirror of
https://github.com/flatpak/flatpak.git
synced 2026-03-27 19:33:06 -04:00
xattrs: Fix possible double-free in get_xattrs_impl
When we free `xattr_name`, we need to transfer ownership away to avoid potential for a double-free if we hit `ENOTSUP` on the next iteration. Reported-by: Seth Arnold <seth.arnold@canonical.com>
This commit is contained in:
@@ -181,7 +181,7 @@ get_xattrs_impl (const char *path,
|
||||
{
|
||||
if (errno == ERANGE)
|
||||
{
|
||||
g_free (xattr_names);
|
||||
g_free (g_steal_pointer (&xattr_names));
|
||||
goto again;
|
||||
}
|
||||
glnx_set_prefix_error_from_errno (error, "%s", "llistxattr");
|
||||
|
||||
Reference in New Issue
Block a user