diff options
author | Pavel Raiskup <praiskup@redhat.com> | 2018-11-23 13:48:34 +0100 |
---|---|---|
committer | Pavel Raiskup <praiskup@redhat.com> | 2018-11-23 14:28:32 +0100 |
commit | ecfd245fbd1b0000540c75da56ad25201d5393b4 (patch) | |
tree | d171770248cafe875abf125edce4a8c66a62e137 /cpio | |
parent | c114bb9fb585e7d74158afa7afbe8c44922479de (diff) | |
download | libarchive-ecfd245fbd1b0000540c75da56ad25201d5393b4.tar.gz |
Fix a few obvious resource leaks and strcpy() misuses
Per Coverity report.
Diffstat (limited to 'cpio')
-rw-r--r-- | cpio/cpio.c | 4 |
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); /* |