This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Commit: Fix memory leak in ar
- From: Nick Clifton <nickc at redhat dot com>
- To: binutils at sourceware dot org
- Date: Tue, 04 Aug 2015 14:50:28 +0100
- Subject: Commit: Fix memory leak in ar
- Authentication-results: sourceware.org; auth=none
Hi Guys,
I am checking in the patch below to close a small memory leak in ar,
should it encounter an invalid patch whilst extracting files.
Cheers
Nick
binutils/ChangeLog
2015-08-04 Nick Clifton <nickc@redhat.com>
* ar.c (extract_file): Free cbuf if the path is invalid.
diff --git a/binutils/ar.c b/binutils/ar.c
index 94c79e2..2765dcc 100644
--- a/binutils/ar.c
+++ b/binutils/ar.c
@@ -1041,6 +1041,7 @@ extract_file (bfd *abfd)
{
non_fatal (_("illegal pathname found in archive member: %s"),
bfd_get_filename (abfd));
+ free (cbuf);
return;
}