Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: gdb-patches@sourceware.org
Subject: RFA: fix PR 8307
Date: Mon, 22 Dec 2008 13:25:00 -0000	[thread overview]
Message-ID: <m3prjkbawi.fsf@fleche.redhat.com> (raw)

PR 8307 is about a small memory leak in environ.c.

This is just the patch from the PR.

Built and regtested on x86-64 (compile farm).
Also I ran it under valgrind, before and after, to verify.

Please review.

Tom

2008-12-22  Adam Denton  <adenton@yahoo.com>

	PR gdb/8307:
	* environ.c (free_environ): Free e->vector.

diff --git a/gdb/environ.c b/gdb/environ.c
index ee471ad..cd40193 100644
--- a/gdb/environ.c
+++ b/gdb/environ.c
@@ -49,6 +49,7 @@ free_environ (struct gdb_environ *e)
   while (*vector)
     xfree (*vector++);
 
+  xfree (e->vector);
   xfree (e);
 }
 


             reply	other threads:[~2008-12-22 13:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-22 13:25 Tom Tromey [this message]
2008-12-22 13:54 ` Joel Brobecker
2008-12-22 14:08   ` Tom Tromey

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=m3prjkbawi.fsf@fleche.redhat.com \
    --to=tromey@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