From: Graham Percival Date: Mon, 13 Jun 2016 23:13:06 +0000 (-0700) Subject: Remove dead code in archive_entry_xattr_add_entry() X-Git-Tag: v3.2.1~10^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F716%2Fhead;p=thirdparty%2Flibarchive.git 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 --- 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");