diff options
author | Alan Modra <amodra@gmail.com> | 2019-12-20 10:01:03 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2019-12-20 13:36:06 +1030 |
commit | fcc5d04f9264b75241fc50cf655a49c9a7de7d76 (patch) | |
tree | 0376d4ad1cb40d05b1f0c95778c7a71ad582be91 /bfd/coff-alpha.c | |
parent | 5c787103a291717333dfea35c063c1ae44655a95 (diff) | |
download | gdb-fcc5d04f9264b75241fc50cf655a49c9a7de7d76.zip gdb-fcc5d04f9264b75241fc50cf655a49c9a7de7d76.tar.gz gdb-fcc5d04f9264b75241fc50cf655a49c9a7de7d76.tar.bz2 |
coff-alpha memory leak
* coff-alpha.c (alpha_ecoff_read_ar_hdr): Free ar_hdr on error return.
Diffstat (limited to 'bfd/coff-alpha.c')
-rw-r--r-- | bfd/coff-alpha.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/bfd/coff-alpha.c b/bfd/coff-alpha.c index d36921b..fe7fcb1 100644 --- a/bfd/coff-alpha.c +++ b/bfd/coff-alpha.c @@ -2026,7 +2026,10 @@ alpha_ecoff_read_ar_hdr (bfd *abfd) if (bfd_seek (abfd, (file_ptr) FILHSZ, SEEK_CUR) != 0 || bfd_bread (ab, (bfd_size_type) 8, abfd) != 8 || bfd_seek (abfd, (file_ptr) (- (FILHSZ + 8)), SEEK_CUR) != 0) - return NULL; + { + free (ret); + return NULL; + } ret->parsed_size = H_GET_64 (abfd, ab); } |