From: Sascha Hauer <s.hauer@pengutronix.de>
To: Jan Luebbe <jlu@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 1/2] parameter: fix memory leak
Date: Fri, 12 Oct 2012 10:03:10 +0200 [thread overview]
Message-ID: <20121012080310.GI27665@pengutronix.de> (raw)
In-Reply-To: <1349865771-18825-1-git-send-email-jlu@pengutronix.de>
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@pengutronix.de>
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@lists.infradead.org
> 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@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
prev parent reply other threads:[~2012-10-12 8:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-10 10:42 Jan Luebbe
2012-10-10 10:42 ` [PATCH 2/2] parameter: support removing named parameters Jan Luebbe
2012-10-12 8:03 ` Sascha Hauer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20121012080310.GI27665@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=jlu@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox