[PATCH] fixed the memory leak in record.c
Jiang Jilin
freephp@gmail.com
Fri Aug 28 00:58:00 GMT 2009
On 8/28/09, Michael Snyder <msnyder@vmware.com> wrote:
> Jiang Jilin wrote:
>> * record.c (record_list_release_next) : fixed memory leak when record
>> type is record_reg
>>
>> Signed-off-by: Jiang Jilin <freephp@gmail.com>
>
> Looks correct to me, though I'd like to hear "ok" from Hui Zhu too.
Sorry, my patch is not OK, and Hui has added a new patch. But he
hasn't checked in his new patch.
> The change is short enough to accept without a copyright assignment.
>
> For future reference, we like to see a full ChangeLog entry with a
> header that would look something like this (it's ok this time):
>
> 2009-08-27 Jiang Jilin <freephp@gmail.com>
>
> * record.c (...): ...
>
> Thank you!
I got it, thank you!
>> ---
>> 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);
>
>
--
Regards,
Jiang
More information about the Gdb-patches
mailing list