]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Remove dead code in archive_entry_xattr_add_entry() 716/head
authorGraham Percival <gperciva@tarsnap.com>
Mon, 13 Jun 2016 23:13:06 +0000 (16:13 -0700)
committerGraham Percival <gperciva@tarsnap.com>
Mon, 13 Jun 2016 23:13:06 +0000 (16:13 -0700)
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

index 20b29d0833c5807f8d7cca7b4f76a91851afdabf..5fe726b99d0c457a1093da0ba3844026b43ca36e 100644 (file)
@@ -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");