From: Graham Percival Date: Wed, 23 Mar 2016 17:20:23 +0000 (-0700) Subject: Check for memory allocation errors in archive_entry_xattr_add_entry X-Git-Tag: v3.2.1~14^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F603%2Fhead;p=thirdparty%2Flibarchive.git Check for memory allocation errors in archive_entry_xattr_add_entry Sponsored by: Tarsnap Backup Inc. --- diff --git a/libarchive/archive_entry_xattr.c b/libarchive/archive_entry_xattr.c index 05eb90f1a..20b29d083 100644 --- a/libarchive/archive_entry_xattr.c +++ b/libarchive/archive_entry_xattr.c @@ -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);