aboutsummaryrefslogtreecommitdiffstats
path: root/libarchive/archive_write_open_fd.c
diff options
context:
space:
mode:
authorMartin Matuska <mm@FreeBSD.org>2020-12-01 10:36:46 +0000
committerMartin Matuska <mm@FreeBSD.org>2020-12-01 10:36:46 +0000
commitd5f2a5ff11474589cccacfc8e153d437f48530e2 (patch)
treeaeb7e201bfb2d629755c396db8001e39d116e852 /libarchive/archive_write_open_fd.c
parent4dd2ae60c22045bc4e4f53a0cf45028322168ec0 (diff)
downloadsrc-d5f2a5ff11474589cccacfc8e153d437f48530e2.tar.gz
src-d5f2a5ff11474589cccacfc8e153d437f48530e2.zip
Update vendor/libarchive/dist to git 833821f55b1807cac22a63a58b759a7802df2fb7vendor/libarchive/3.5.0
Libarchive 3.5.0 Relevant vendor changes: Issue #1258: add archive_read_support_filter_by_code() PR #1347: mtree digest reader support Issue #1381: skip hardlinks pointing to itself on extraction PR #1387: fix writing of cpio archives with hardlinks without file type PR #1388: fix rdev field in cpio format for device nodes PR #1389: completed support for UTF-8 encoding conversion PR #1405: more formats in archive_read_support_format_by_code() PR #1408: fix uninitialized size in rar5_read_data PR #1409: system extended attribute support PR #1435: support for decompression of symbolic links in zipx archives Issue #1456: memory leak after unsuccessful archive_write_open_filename
Notes
Notes: svn path=/vendor/libarchive/dist/; revision=368207 svn path=/vendor/libarchive/3.5.0/; revision=368208; tag=vendor/libarchive/3.5.0
Diffstat (limited to 'libarchive/archive_write_open_fd.c')
-rw-r--r--libarchive/archive_write_open_fd.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libarchive/archive_write_open_fd.c b/libarchive/archive_write_open_fd.c
index d5c426cf978c..b8d491faa273 100644
--- a/libarchive/archive_write_open_fd.c
+++ b/libarchive/archive_write_open_fd.c
@@ -54,7 +54,7 @@ struct write_fd_data {
int fd;
};
-static int file_close(struct archive *, void *);
+static int file_free(struct archive *, void *);
static int file_open(struct archive *, void *);
static ssize_t file_write(struct archive *, void *, const void *buff, size_t);
@@ -72,8 +72,8 @@ archive_write_open_fd(struct archive *a, int fd)
#if defined(__CYGWIN__) || defined(_WIN32)
setmode(mine->fd, O_BINARY);
#endif
- return (archive_write_open(a, mine,
- file_open, file_write, file_close));
+ return (archive_write_open2(a, mine,
+ file_open, file_write, NULL, file_free));
}
static int
@@ -134,11 +134,13 @@ file_write(struct archive *a, void *client_data, const void *buff, size_t length
}
static int
-file_close(struct archive *a, void *client_data)
+file_free(struct archive *a, void *client_data)
{
struct write_fd_data *mine = (struct write_fd_data *)client_data;
(void)a; /* UNUSED */
+ if (mine == NULL)
+ return (ARCHIVE_OK);
free(mine);
return (ARCHIVE_OK);
}