From 71b44796d9533309abbe22e7b26d3ee5bb3d0251 Mon Sep 17 00:00:00 2001 From: Tim Kientzle Date: Mon, 5 Apr 2004 21:12:29 +0000 Subject: 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. --- lib/libarchive/archive_read_open_file.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'lib/libarchive/archive_read_open_file.c') 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; -- cgit v1.2.3