From 4c3677b8875323e5f844d1fd47feaf0dbd58c8fa Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Mon, 25 Jan 2021 15:38:14 +0000 Subject: ar: only free temporary filename if required --- archival/ar.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/archival/ar.c b/archival/ar.c index eb734a685..1879ec79f 100644 --- a/archival/ar.c +++ b/archival/ar.c @@ -200,9 +200,10 @@ static int write_ar_archive(archive_handle_t *handle) } #if ENABLE_PLATFORM_MINGW32 - if ( temp_fn != NULL ) { + if (temp_fn != NULL) { xrename(temp_fn, handle->ar__name); - free(temp_fn); + if (ENABLE_FEATURE_CLEAN_UP) + free(temp_fn); } #endif -- cgit v1.2.3-55-g6feb