summaryrefslogtreecommitdiffstats
path: root/Utilities/cmlibarchive/libarchive/archive_write_open_filename.c
diff options
context:
space:
mode:
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);