]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Re: binary outsymbols
authorAlan Modra <amodra@gmail.com>
Sat, 18 Jan 2025 00:25:22 +0000 (10:55 +1030)
committerAlan Modra <amodra@gmail.com>
Sat, 18 Jan 2025 00:28:17 +0000 (10:58 +1030)
The "of course to free outsymbols" turned out to be wrong.  outsymbols
belongs to objcopy which frees them, so commit 6ca01b0bdd59 introduced
a double free.

* srec.c (srec_write_symbols): Don't free outsymbols.
* tekhex.c (tekhex_write_object_contents): Likewise.

bfd/srec.c
bfd/tekhex.c

index a7ccf232531302c09c3d1f38c942c6030dee3c09..1509bebd6c1cc52cb988cc25a659b564e378c2b6 100644 (file)
@@ -1114,13 +1114,9 @@ srec_write_symbols (bfd *abfd)
        goto fail;
     }
 
-  free (abfd->outsymbols);
-  abfd->outsymbols = NULL;
   return true;
 
  fail:
-  free (abfd->outsymbols);
-  abfd->outsymbols = NULL;
   return false;
 }
 
index ef2bb25fe46c35a5f6e35b85d43135585f991d7b..aab0b2f5592607d15c6026edf0359234964959a1 100644 (file)
@@ -886,13 +886,9 @@ tekhex_write_object_contents (bfd *abfd)
   /* And the terminator.  */
   if (bfd_write ("%0781010\n", 9, abfd) != 9)
     goto fail;
-  free (abfd->outsymbols);
-  abfd->outsymbols = NULL;
   return true;
 
  fail:
-  free (abfd->outsymbols);
-  abfd->outsymbols = NULL;
   return false;
 }