[PATCH] fixed the memory leak in record.c

Michael Snyder msnyder@vmware.com
Thu Aug 27 18:28:00 GMT 2009


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.

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!

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



More information about the Gdb-patches mailing list