All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@pond.sub.org>
To: Zhu Wei <zachwade.k@gmail.com>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	niming <niming@sangfor.com.cn>, zhuwei <zhuwei@sangfor.com.cn>
Subject: Re: [PATCH v3 1/1 ] block/monitor: fix BlockJobInfoList leak in hmp_info_block_jobs()
Date: Mon, 23 Nov 2026 13:57:39 +0100	[thread overview]
Message-ID: <87eccbwvr0.fsf@pond.sub.org> (raw)
In-Reply-To: <20261123100920.2966172-2-zhuwei@sangfor.com.cn> (Zhu Wei's message of "Mon, 23 Nov 2026 18:08:49 +0800")

Zhu Wei <zachwade.k@gmail.com> writes:

> From: zhuwei <zhuwei@sangfor.com.cn>
>
> hmp_info_block_jobs() uses 'list' both as the head of the BlockJobInfoList
> returned by qmp_query_block_jobs() and as the iterator of the while loop.
> Once the loop finishes, 'list' is NULL, so the call to
> qapi_free_BlockJobInfoList(list) at the end of the function frees nothing
> and the whole list returned by qmp_query_block_jobs() is leaked.
>
> Keep the head of the list in a separate variable and free that one after
> the loop, so the entire list is released as intended.
>
> Fixes: fb5458cd10a1 ("qmp: add query-block-jobs")

Still wrong: the line you fix doesn't exist there.  Please slow down some.

I believe it is

  Fixes: 93bb1315250d ("hmp: fix memory leak at hmp_info_block_jobs()")

> Signed-off-by: niming <niming@sangfor.com.cn>
> Signed-off-by: zhuwei <zhuwei@sangfor.com.cn>
> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>


      reply	other threads:[~2026-11-23 12:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23 10:08 [PATCH v3 0/1] block/monitor: fix BlockJobInfoList leak in hmp_info_block_jobs() Zhu Wei
2026-11-23 10:08 ` [PATCH v3 1/1 ] " Zhu Wei
2026-11-23 12:57   ` Markus Armbruster [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=87eccbwvr0.fsf@pond.sub.org \
    --to=armbru@pond.sub.org \
    --cc=marcandre.lureau@redhat.com \
    --cc=niming@sangfor.com.cn \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=zachwade.k@gmail.com \
    --cc=zhuwei@sangfor.com.cn \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.