Re: [PATCH 1/2] parameter: fix memory leak

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Oct 10, 2012 at 12:42:50PM +0200, Jan Luebbe wrote:
> In __dev_add_param, the name string is allocated using strdup.
> Free it when removing the parameter.
> 
> Signed-off-by: Jan Luebbe <jlu@xxxxxxxxxxxxxx>

Applied, thanks

Sascha

> ---
>  lib/parameter.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/lib/parameter.c b/lib/parameter.c
> index 3ecb480..b33ad17 100644
> --- a/lib/parameter.c
> +++ b/lib/parameter.c
> @@ -224,6 +224,7 @@ void dev_remove_parameters(struct device_d *dev)
>  	list_for_each_entry_safe(p, n, &dev->parameters, list) {
>  		p->set(dev, p, NULL);
>  		list_del(&p->list);
> +		free(p->name);
>  		free(p);
>  	}
>  }
> -- 
> 1.7.10.4
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@xxxxxxxxxxxxxxxxxxx
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox


[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux