mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-12-18 08:49:29 +08:00
Re: binary outsymbols
The "of course to free outsymbols" turned out to be wrong. outsymbols
belongs to objcopy which frees them, so commit 6ca01b0bdd introduced
a double free.
* srec.c (srec_write_symbols): Don't free outsymbols.
* tekhex.c (tekhex_write_object_contents): Likewise.
This commit is contained in:
@@ -1114,13 +1114,9 @@ srec_write_symbols (bfd *abfd)
|
|||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
free (abfd->outsymbols);
|
|
||||||
abfd->outsymbols = NULL;
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
free (abfd->outsymbols);
|
|
||||||
abfd->outsymbols = NULL;
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -886,13 +886,9 @@ tekhex_write_object_contents (bfd *abfd)
|
|||||||
/* And the terminator. */
|
/* And the terminator. */
|
||||||
if (bfd_write ("%0781010\n", 9, abfd) != 9)
|
if (bfd_write ("%0781010\n", 9, abfd) != 9)
|
||||||
goto fail;
|
goto fail;
|
||||||
free (abfd->outsymbols);
|
|
||||||
abfd->outsymbols = NULL;
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
free (abfd->outsymbols);
|
|
||||||
abfd->outsymbols = NULL;
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user