* [binutils-gdb] Re: objcopy write_debugging_info memory leaks
@ 2023-04-06 12:00 Alan Modra
0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2023-04-06 12:00 UTC (permalink / raw)
To: bfd-cvs
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=11aa9f628e28c077c860480571c152e07e6a4938
commit 11aa9f628e28c077c860480571c152e07e6a4938
Author: Alan Modra <amodra@gmail.com>
Date: Thu Apr 6 21:25:22 2023 +0930
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.
Diff:
---
binutils/wrstabs.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/binutils/wrstabs.c b/binutils/wrstabs.c
index b676374558b..234a96f98a3 100644
--- a/binutils/wrstabs.c
+++ b/binutils/wrstabs.c
@@ -464,7 +464,7 @@ write_stabs_in_sections_debugging_info (bfd *abfd, void *dhandle,
bfd_size_type *pstringsize)
{
struct stab_write_handle info;
- struct string_hash_entry *h, *hnext;
+ struct string_hash_entry *h;
bfd_byte *p;
bool ret;
@@ -535,11 +535,6 @@ write_stabs_in_sections_debugging_info (bfd *abfd, void *dhandle,
free (info.symbols);
ret = false;
out:
- for (h = info.strings; h != NULL; h = hnext)
- {
- hnext = h->next;
- free (h);
- }
while (info.type_stack != NULL)
{
struct stab_type_stack *s = info.type_stack;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-04-06 12:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-06 12:00 [binutils-gdb] Re: objcopy write_debugging_info memory leaks 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).