mirror of
https://github.com/libarchive/libarchive.git
synced 2026-01-27 01:44:27 +00:00
Merge pull request #601 from Tarsnap/strdup-allocation-failure-check
Check for strdup() allocation failure
This commit is contained in:
commit
16dbeeb552
@ -98,7 +98,10 @@ archive_entry_xattr_add_entry(struct archive_entry *entry,
|
||||
/* XXX Error XXX */
|
||||
return;
|
||||
|
||||
xp->name = strdup(name);
|
||||
if ((xp->name = strdup(name)) == NULL)
|
||||
/* XXX Error XXX */
|
||||
return;
|
||||
|
||||
if ((xp->value = malloc(size)) != NULL) {
|
||||
memcpy(xp->value, value, size);
|
||||
xp->size = size;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user