fails with `ARCHIVE_FAILED`
This greatly reduces memory usage when the call fails, e.g. a file cannot be
stat'ed
Confirmed with the following snippet:
% d=/tmp/cpio_test
% mkdir -p $d
% while : ; do echo /nonexistent ; done | cpio -dump $d 2>/dev/null
Reported by: Coverity
CID:
1016757
lafe_warnc(0, "%s",
archive_error_string(cpio->archive_read_disk));
if (r <= ARCHIVE_FAILED) {
+ archive_entry_free(entry);
cpio->return_value = 1;
return (r);
}