From: Peter Xu <peterx@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org, patches@linaro.org
Subject: Re: [Qemu-devel] [PATCH] hw/arm/iotkit.c: fix minor memory leak
Date: Tue, 8 May 2018 18:37:34 +0800 [thread overview]
Message-ID: <20180508103734.GB19024@xz-mi> (raw)
In-Reply-To: <20180427110137.19304-1-peter.maydell@linaro.org>
On Fri, Apr 27, 2018 at 12:01:37PM +0100, Peter Maydell wrote:
> Coverity (CID1390573) spots that we forgot to free the
> gpioname strings in a loop in the iotkit realize function.
> Correct the error.
>
> This isn't a significant leak, because this function
> only ever runs once.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
I believe this even does not require ARM knowledges, so:
Reviewed-by: Peter Xu <peterx@redhat.com>
> ---
> hw/arm/iotkit.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/hw/arm/iotkit.c b/hw/arm/iotkit.c
> index c5f0a5b98a..234185e8f7 100644
> --- a/hw/arm/iotkit.c
> +++ b/hw/arm/iotkit.c
> @@ -517,6 +517,7 @@ static void iotkit_realize(DeviceState *dev, Error **errp)
> qdev_get_gpio_in(DEVICE(&s->ppc_irq_orgate), i));
> qdev_connect_gpio_out_named(DEVICE(ppc), "irq", 0,
> qdev_get_gpio_in(devs, 0));
> + g_free(gpioname);
> }
>
> iotkit_forward_sec_resp_cfg(s);
> --
> 2.17.0
>
>
--
Peter Xu
prev parent reply other threads:[~2018-05-08 10:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-27 11:01 [Qemu-devel] [PATCH] hw/arm/iotkit.c: fix minor memory leak Peter Maydell
2018-05-08 9:16 ` [Qemu-devel] [Qemu-arm] " Peter Maydell
2018-05-08 13:04 ` Philippe Mathieu-Daudé
2018-05-08 10:37 ` Peter Xu [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=20180508103734.GB19024@xz-mi \
--to=peterx@redhat.com \
--cc=patches@linaro.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
/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;
as well as URLs for NNTP newsgroup(s).