From 8135eecf4530796050d0987e825cb6d2f99f6740 Mon Sep 17 00:00:00 2001 From: Graham Percival Date: Wed, 23 Mar 2016 10:20:23 -0700 Subject: [PATCH] Check for memory allocation errors in archive_entry_xattr_add_entry Sponsored by: Tarsnap Backup Inc. --- libarchive/archive_entry_xattr.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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); -- 2.47.2