qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Hao Wu <wuhaotsh@google.com>
To: Miaoqian Lin <linmq006@gmail.com>
Cc: Havard Skinnemoen <hskinnemoen@google.com>,
	Tyrone Ting <kfting@nuvoton.com>,  Thomas Huth <thuth@redhat.com>,
	Laurent Vivier <lvivier@redhat.com>,
	 Paolo Bonzini <pbonzini@redhat.com>,
	qemu-arm <qemu-arm@nongnu.org>,
	 QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [PATCH] qtest/npcm7xx_pwm-test: Fix memory leak in mft_qom_set
Date: Tue, 31 May 2022 09:31:24 -0700	[thread overview]
Message-ID: <CAGcCb129Mz-ZDSc_wFF=Z6SiNHiC6Lnr+4TGvUKMOaYWchaCPg@mail.gmail.com> (raw)
In-Reply-To: <20220531080921.4704-1-linmq006@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 927 bytes --]

On Tue, May 31, 2022 at 6:18 AM Miaoqian Lin <linmq006@gmail.com> wrote:

> g_strdup_printf() allocated memory for path, we should free it with
> g_free() when no longer needed.
>
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
>
Reviewed-by: Hao Wu <wuhaotsh@google.com>

> ---
>  tests/qtest/npcm7xx_pwm-test.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/tests/qtest/npcm7xx_pwm-test.c
> b/tests/qtest/npcm7xx_pwm-test.c
> index c4a5fdcacd79..e320a625c4b6 100644
> --- a/tests/qtest/npcm7xx_pwm-test.c
> +++ b/tests/qtest/npcm7xx_pwm-test.c
> @@ -268,6 +268,9 @@ static void mft_qom_set(QTestState *qts, int index,
> const char *name,
>              path, name, value);
>      /* The qom set message returns successfully. */
>      g_assert_true(qdict_haskey(response, "return"));
> +
> +    qobject_unref(response);
> +    g_free(path);
>  }
>
>  static uint32_t get_pll(uint32_t con)
> --
> 2.25.1
>
>
>

[-- Attachment #2: Type: text/html, Size: 1593 bytes --]

      reply	other threads:[~2022-05-31 16:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-31  8:09 [PATCH] qtest/npcm7xx_pwm-test: Fix memory leak in mft_qom_set Miaoqian Lin
2022-05-31 16:31 ` Hao Wu [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='CAGcCb129Mz-ZDSc_wFF=Z6SiNHiC6Lnr+4TGvUKMOaYWchaCPg@mail.gmail.com' \
    --to=wuhaotsh@google.com \
    --cc=hskinnemoen@google.com \
    --cc=kfting@nuvoton.com \
    --cc=linmq006@gmail.com \
    --cc=lvivier@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    /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).