This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RFA: fix PR 8307
- From: Tom Tromey <tromey at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Mon, 22 Dec 2008 06:24:29 -0700
- Subject: RFA: fix PR 8307
- Reply-to: tromey at redhat dot com
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);
}