Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Gary Benson <gbenson@redhat.com>
To: gdb-patches@sourceware.org
Subject: [RFA] Fix memory leak in solib-svr4.c
Date: Tue, 14 Aug 2012 12:45:00 -0000	[thread overview]
Message-ID: <20120814124441.GA19388@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 234 bytes --]

Hi all,

I found a memory leak in solib-svr4.c: svr4_free_library_list uses
svr4_free_so, which frees the inner parts of the so_list but not
the so_list itself.  This patch fixes.

Ok to commit?

Thanks,
Gary

-- 
http://gbenson.net/

[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 533 bytes --]

Organization: Red Hat UK Ltd, 64 Baker Street, 4th Floor, W1U 7DF, UK.
	Registered in England and Wales (3798903)

2012-08-14  Gary Benson  <gbenson@redhat.com>

	* solib-svr4.c (svr4_free_library_list): Use free_so.

diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
index 76bd872..2f4a345 100644
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
@@ -980,7 +980,7 @@ svr4_free_library_list (void *p_list)
     {
       struct so_list *next = list->next;
 
-      svr4_free_so (list);
+      free_so (list);
       list = next;
     }
 }

             reply	other threads:[~2012-08-14 12:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-14 12:45 Gary Benson [this message]
2012-08-14 15:14 ` Tom Tromey
2012-08-14 16:17   ` Gary Benson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120814124441.GA19388@redhat.com \
    --to=gbenson@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox