mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-12-18 16:57:56 +08:00
Re: objcopy write_debugging_info memory leaks
Oops, tried to free too much * wrstabs.c (write_stabs_in_sections_debugging_info): Don't free strings.
This commit is contained in:
@@ -464,7 +464,7 @@ write_stabs_in_sections_debugging_info (bfd *abfd, void *dhandle,
|
|||||||
bfd_size_type *pstringsize)
|
bfd_size_type *pstringsize)
|
||||||
{
|
{
|
||||||
struct stab_write_handle info;
|
struct stab_write_handle info;
|
||||||
struct string_hash_entry *h, *hnext;
|
struct string_hash_entry *h;
|
||||||
bfd_byte *p;
|
bfd_byte *p;
|
||||||
bool ret;
|
bool ret;
|
||||||
|
|
||||||
@@ -535,11 +535,6 @@ write_stabs_in_sections_debugging_info (bfd *abfd, void *dhandle,
|
|||||||
free (info.symbols);
|
free (info.symbols);
|
||||||
ret = false;
|
ret = false;
|
||||||
out:
|
out:
|
||||||
for (h = info.strings; h != NULL; h = hnext)
|
|
||||||
{
|
|
||||||
hnext = h->next;
|
|
||||||
free (h);
|
|
||||||
}
|
|
||||||
while (info.type_stack != NULL)
|
while (info.type_stack != NULL)
|
||||||
{
|
{
|
||||||
struct stab_type_stack *s = info.type_stack;
|
struct stab_type_stack *s = info.type_stack;
|
||||||
|
|||||||
Reference in New Issue
Block a user