public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix memory leak in watch_main_source_file_lossage
@ 2014-11-11  1:00 Doug Evans
  2014-11-18 17:06 ` Doug Evans
  0 siblings, 1 reply; 2+ messages in thread
From: Doug Evans @ 2014-11-11  1:00 UTC (permalink / raw)
  To: gdb-patches

Hi.

I happened to notice this memory leak while hacking on buildsym.c.

Regression tested on amd64-linux.

2014-11-10  Doug Evans  <xdje42@gmail.com>

	* buildsym.c (watch_main_source_file_lossage): Fix memory leak.

diff --git a/gdb/buildsym.c b/gdb/buildsym.c
index ef7e809..5a4fa06 100644
--- a/gdb/buildsym.c
+++ b/gdb/buildsym.c
@@ -1002,6 +1002,8 @@ watch_main_source_file_lossage (void)
 	    subfiles = mainsub_alias->next;
 	  else
 	    prev_mainsub_alias->next = mainsub_alias->next;
+	  xfree (mainsub_alias->name);
+	  xfree (mainsub_alias->dirname);
 	  xfree (mainsub_alias);
 	}
     }

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix memory leak in watch_main_source_file_lossage
  2014-11-11  1:00 [PATCH] Fix memory leak in watch_main_source_file_lossage Doug Evans
@ 2014-11-18 17:06 ` Doug Evans
  0 siblings, 0 replies; 2+ messages in thread
From: Doug Evans @ 2014-11-18 17:06 UTC (permalink / raw)
  To: gdb-patches

On Mon, Nov 10, 2014 at 4:59 PM, Doug Evans <xdje42@gmail.com> wrote:
> Hi.
>
> I happened to notice this memory leak while hacking on buildsym.c.
>
> Regression tested on amd64-linux.
>
> 2014-11-10  Doug Evans  <xdje42@gmail.com>
>
>         * buildsym.c (watch_main_source_file_lossage): Fix memory leak.

Committed.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-11-18 17:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-11  1:00 [PATCH] Fix memory leak in watch_main_source_file_lossage Doug Evans
2014-11-18 17:06 ` Doug Evans

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).