From: Nick Clifton Date: Fri, 17 Nov 2017 12:44:16 +0000 (+0000) Subject: Fix a memory leak when processing archives. X-Git-Tag: users/ARM/embedded-binutils-master-2017q4~181 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3cfd3dd0956fe854a07795de12c1302ecabbd819;p=thirdparty%2Fbinutils-gdb.git Fix a memory leak when processing archives. PR 22449 * ar.c (write_archive): Free the temporary file name. --- diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 16e93d763ac..caf9647e4a8 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,8 @@ +2017-11-17 Nick Clifton + + PR 22449 + * ar.c (write_archive): Free the temporary file name. + 2017-11-17 Nick Clifton * readelf.c (process_archive): Include member name in the diff --git a/binutils/ar.c b/binutils/ar.c index 25f3b3d0bf0..9de0d13be14 100644 --- a/binutils/ar.c +++ b/binutils/ar.c @@ -1197,6 +1197,7 @@ write_archive (bfd *iarch) if (smart_rename (new_name, old_name, 0) != 0) xexit (1); free (old_name); + free (new_name); } /* Return a pointer to the pointer to the entry which should be rplacd'd