aboutsummaryrefslogtreecommitdiff
path: root/binutils/ar.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2017-11-17 12:44:16 +0000
committerNick Clifton <nickc@redhat.com>2017-11-17 12:46:07 +0000
commit3cfd3dd0956fe854a07795de12c1302ecabbd819 (patch)
tree1a483894e4971b8522429c43282d920419578ec9 /binutils/ar.c
parent2c244f9b0935e577d7c20bb5706e27438e48227f (diff)
downloadgdb-3cfd3dd0956fe854a07795de12c1302ecabbd819.zip
gdb-3cfd3dd0956fe854a07795de12c1302ecabbd819.tar.gz
gdb-3cfd3dd0956fe854a07795de12c1302ecabbd819.tar.bz2
Fix a memory leak when processing archives.
PR 22449 * ar.c (write_archive): Free the temporary file name.
Diffstat (limited to 'binutils/ar.c')
-rw-r--r--binutils/ar.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/binutils/ar.c b/binutils/ar.c
index 25f3b3d..9de0d13 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