aboutsummaryrefslogtreecommitdiff
path: root/lib/libarchive/archive_read_open_file.c
diff options
context:
space:
mode:
authorTim Kientzle <kientzle@FreeBSD.org>2004-04-05 21:12:29 +0000
committerTim Kientzle <kientzle@FreeBSD.org>2004-04-05 21:12:29 +0000
commit71b44796d9533309abbe22e7b26d3ee5bb3d0251 (patch)
tree65c99eaf5f048beaa6a7d9973eb8410048b1f15d /lib/libarchive/archive_read_open_file.c
parent7f8a436ff29ebeb1ce2ae2434add4505d5e7e2ca (diff)
Overhauled ACL support. This makes us compatible
with 'star' ACL handling, though there's still a bit more work needed in this area. Added 'write_open_fd' and 'read_open_fd' to simplify, e.g., tar's u and r modes. Eliminated old 'write_open_file_position' as a bad idea. (It required closing/reopening files to do updates, which led to unpleasant implications.) Various other minor fixes, API tweaks, etc.
Notes
Notes: svn path=/head/; revision=127912
Diffstat (limited to 'lib/libarchive/archive_read_open_file.c')
-rw-r--r--lib/libarchive/archive_read_open_file.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/libarchive/archive_read_open_file.c b/lib/libarchive/archive_read_open_file.c
index a07ff2957078..772e1cc21d73 100644
--- a/lib/libarchive/archive_read_open_file.c
+++ b/lib/libarchive/archive_read_open_file.c
@@ -55,12 +55,19 @@ archive_read_open_file(struct archive *a, const char *filename,
{
struct read_file_data *mine;
- /* XXX detect and report malloc failure XXX */
if (filename == NULL) {
mine = malloc(sizeof(*mine));
+ if (mine == NULL) {
+ archive_set_error(a, ENOMEM, "No memory");
+ return (ARCHIVE_FATAL);
+ }
mine->filename[0] = 0;
} else {
mine = malloc(sizeof(*mine) + strlen(filename));
+ if (mine == NULL) {
+ archive_set_error(a, ENOMEM, "No memory");
+ return (ARCHIVE_FATAL);
+ }
strcpy(mine->filename, filename);
}
mine->block_size = block_size;