This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Fix memory leak in ar if it encounters an invalid path whilst extracting files.


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=4e13f8fb05eb7ffd163d96e519cc011d8d21e3d7

commit 4e13f8fb05eb7ffd163d96e519cc011d8d21e3d7
Author: Nick Clifton <nickc@redhat.com>
Date:   Tue Aug 4 14:50:40 2015 +0100

    Fix memory leak in ar if it encounters an invalid path whilst extracting files.
    
    	* ar.c (extract_file): Free cbuf if the path is invalid.

Diff:
---
 binutils/ar.c | 1 +
 1 file changed, 1 insertion(+)

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;
     }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]