Merge pull request #3191 from stoeckmann/xattr_malloc

This commit is contained in:
Dustin L. Howett authored and GitHub committed 2026-06-28 08:29:11 -05:00
commit 25ea451941
1 file changed
+5 -5
+5 -5
View File
@@ -97,11 +97,11 @@ archive_entry_xattr_add_entry(struct archive_entry *entry,
if ((xp->name = strdup(name)) == NULL)
__archive_errx(1, "Out of memory");
if ((xp->value = malloc(size)) != NULL) {
memcpy(xp->value, value, size);
xp->size = size;
} else
xp->size = 0;
if ((xp->value = malloc(size)) == NULL)
__archive_errx(1, "Out of memory");
memcpy(xp->value, value, size);
xp->size = size;
xp->next = entry->xattr_head;
entry->xattr_head = xp;