]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Check for memory allocation errors in archive_entry_xattr_add_entry 603/head
authorGraham Percival <gperciva@tarsnap.com>
Wed, 23 Mar 2016 17:20:23 +0000 (10:20 -0700)
committerGraham Percival <gperciva@tarsnap.com>
Wed, 23 Mar 2016 17:20:23 +0000 (10:20 -0700)
Sponsored by: Tarsnap Backup Inc.

libarchive/archive_entry_xattr.c

index 05eb90f1afd1ff1188c9604007c4de5da6206b60..20b29d0833c5807f8d7cca7b4f76a91851afdabf 100644 (file)
@@ -95,12 +95,10 @@ archive_entry_xattr_add_entry(struct archive_entry *entry,
                ;
 
        if ((xp = (struct ae_xattr *)malloc(sizeof(struct ae_xattr))) == NULL)
-               /* XXX Error XXX */
-               return;
+               __archive_errx(1, "Out of memory");
 
        if ((xp->name = strdup(name)) == NULL)
-               /* XXX Error XXX */
-               return;
+               __archive_errx(1, "Out of memory");
 
        if ((xp->value = malloc(size)) != NULL) {
                memcpy(xp->value, value, size);