summaryrefslogtreecommitdiffstats
path: root/Utilities/cmlibarchive/libarchive/archive_write_open_filename.c
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-10-21 14:12:35 (GMT)
committerBrad King <brad.king@kitware.com>2015-10-21 14:18:52 (GMT)
commit932848f420a738ee07997198fead5b2c2fbf4787 (patch)
tree40404c3244ba87c5e71e8dd076f4dbcde6d8cfeb /Utilities/cmlibarchive/libarchive/archive_write_open_filename.c
parente4b7d5afde91efafb59749a0a513732a089a6f0a (diff)
parent1a8c7bc2c649781d1163c1966245a45e0fb829ba (diff)
downloadCMake-932848f420a738ee07997198fead5b2c2fbf4787.zip
CMake-932848f420a738ee07997198fead5b2c2fbf4787.tar.gz
CMake-932848f420a738ee07997198fead5b2c2fbf4787.tar.bz2
Merge branch 'libarchive-upstream' into update-libarchive
Resolve conflicts by integrating changes from both sides.
Diffstat (limited to 'Utilities/cmlibarchive/libarchive/archive_write_open_filename.c')
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_write_open_filename.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Utilities/cmlibarchive/libarchive/archive_write_open_filename.c b/Utilities/cmlibarchive/libarchive/archive_write_open_filename.c
index 196b770..66e0dfe 100644
--- a/Utilities/cmlibarchive/libarchive/archive_write_open_filename.c
+++ b/Utilities/cmlibarchive/libarchive/archive_write_open_filename.c
@@ -243,7 +243,10 @@ file_close(struct archive *a, void *client_data)
struct write_file_data *mine = (struct write_file_data *)client_data;
(void)a; /* UNUSED */
- close(mine->fd);
+
+ if (mine->fd >= 0)
+ close(mine->fd);
+
archive_mstring_clean(&mine->filename);
free(mine);
return (ARCHIVE_OK);