summaryrefslogtreecommitdiff
path: root/cpio/cpio.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpio/cpio.c')
-rw-r--r--cpio/cpio.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/cpio/cpio.c b/cpio/cpio.c
index 9dddf417..4fd394de 100644
--- a/cpio/cpio.c
+++ b/cpio/cpio.c
@@ -755,8 +755,10 @@ file_to_archive(struct cpio *cpio, const char *srcpath)
}
if (cpio->option_rename)
destpath = cpio_rename(destpath);
- if (destpath == NULL)
+ if (destpath == NULL) {
+ archive_entry_free(entry);
return (0);
+ }
archive_entry_copy_pathname(entry, destpath);
/*