]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
vms-alpha: Free memory on failure path
authorAlan Modra <amodra@gmail.com>
Thu, 31 Aug 2023 09:10:40 +0000 (18:40 +0930)
committerAlan Modra <amodra@gmail.com>
Thu, 31 Aug 2023 12:05:39 +0000 (21:35 +0930)
* vms-alpha.c (evax_bfd_print_eobj): Free rec on failure.

bfd/vms-alpha.c

index f4d1e009d063487ce4960a5e6df98b03fab5035e..9689dcb87381dcee85a21e66b81ef0e5aaa5bd20 100644 (file)
@@ -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;