public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* vms-alpha: Free memory on failure path
@ 2023-08-31 12:13 Alan Modra
  0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2023-08-31 12:13 UTC (permalink / raw)
  To: binutils

	* vms-alpha.c (evax_bfd_print_eobj): Free rec on failure.

diff --git a/bfd/vms-alpha.c b/bfd/vms-alpha.c
index f4d1e009d06..9689dcb8738 100644
--- a/bfd/vms-alpha.c
+++ b/bfd/vms-alpha.c
@@ -6972,6 +6972,7 @@ evax_bfd_print_eobj (struct bfd *abfd, FILE *file)
 	  != pad_len - hdr_size)
 	{
 	  fprintf (file, _("cannot read GST record\n"));
+	  free (rec);
 	  return;
 	}
 
@@ -6987,7 +6988,6 @@ evax_bfd_print_eobj (struct bfd *abfd, FILE *file)
 	  evax_bfd_print_eeom (file, rec, rec_len);
 	  free (rec);
 	  return;
-	  break;
 	case EOBJ__C_ETIR:
 	  evax_bfd_print_etir (file, "ETIR", rec, rec_len);
 	  break;

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-08-31 12:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-31 12:13 vms-alpha: Free memory on failure path Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).