Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] fixed the memory leak in record.c
@ 2009-08-27  5:26 Jiang Jilin
  2009-08-27  6:34 ` Hui Zhu
  2009-08-27 18:28 ` Michael Snyder
  0 siblings, 2 replies; 7+ messages in thread
From: Jiang Jilin @ 2009-08-27  5:26 UTC (permalink / raw)
  To: teawater; +Cc: gdb-patches, Jiang Jilin

	* record.c (record_list_release_next) : fixed memory leak when record type is record_reg

Signed-off-by: Jiang Jilin <freephp@gmail.com>
---
 gdb/record.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/gdb/record.c b/gdb/record.c
index 8afca6b..07e9e80 100644
--- a/gdb/record.c
+++ b/gdb/record.c
@@ -158,9 +158,10 @@ record_list_release_next (void)
     {
       rec = tmp->next;
       if (tmp->type == record_reg)
-	record_insn_num--;
-      else if (tmp->type == record_reg)
-	xfree (tmp->u.reg.val);
+	{
+	  record_insn_num--;
+	  xfree (tmp->u.reg.val);
+	}
       else if (tmp->type == record_mem)
 	xfree (tmp->u.mem.val);
       xfree (tmp);
-- 
1.5.4.3


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

end of thread, other threads:[~2009-08-28  2:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-27  5:26 [PATCH] fixed the memory leak in record.c Jiang Jilin
2009-08-27  6:34 ` Hui Zhu
2009-08-28  1:35   ` Hui Zhu
2009-08-28  1:57     ` Michael Snyder
2009-08-28  3:05       ` Hui Zhu
2009-08-27 18:28 ` Michael Snyder
2009-08-28  0:58   ` Jiang Jilin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox