From c7fb9682b1a0a98f11c9d62bc238556a6e4f6066 Mon Sep 17 00:00:00 2001 From: Graham Percival Date: Mon, 13 Jun 2016 16:13:06 -0700 Subject: [PATCH] Remove dead code in archive_entry_xattr_add_entry() The code seems to be walking through the linked list beginning at entry->xattr_head, but then it immediately sets xp to be something different. This is 10-year old code; it was added in the first "POSIX.1e-style Extended Attribute support" commit, on March 21 2006: https://svnweb.freebsd.org/base/head/lib/libarchive/archive_entry.c?annotate=156961&pathrev=156961#l1387 --- libarchive/archive_entry_xattr.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/libarchive/archive_entry_xattr.c b/libarchive/archive_entry_xattr.c index 20b29d083..5fe726b99 100644 --- a/libarchive/archive_entry_xattr.c +++ b/libarchive/archive_entry_xattr.c @@ -91,9 +91,6 @@ archive_entry_xattr_add_entry(struct archive_entry *entry, { struct ae_xattr *xp; - for (xp = entry->xattr_head; xp != NULL; xp = xp->next) - ; - if ((xp = (struct ae_xattr *)malloc(sizeof(struct ae_xattr))) == NULL) __archive_errx(1, "Out of memory"); -- 2.47.2