This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] fixed the memory leak in record.c
- From: Jiang Jilin <freephp at gmail dot com>
- To: teawater at gmail dot com
- Cc: gdb-patches at sourceware dot org, Jiang Jilin <freephp at gmail dot com>
- Date: Thu, 27 Aug 2009 11:11:34 +0800
- Subject: [PATCH] fixed the memory leak in record.c
- References: <>
* 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