This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RFA: fix PR 8307


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);
 }
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]