All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Cc: Kamil Dudka <kdudka@redhat.com>
Subject: Re: [PATCH] qtest: do not return freed argument vector from qtest_rsp
Date: Fri, 20 Nov 2020 13:38:06 +0100	[thread overview]
Message-ID: <52f3190b-7a4a-046f-5708-c07093612895@redhat.com> (raw)
In-Reply-To: <20201120073149.99079-1-pbonzini@redhat.com>

On 20/11/2020 08.31, Paolo Bonzini wrote:
> If expected_args is 0, qtest frees the argument vector and then returns it
> nevertheless.  Coverity complains; in practice this is not an issue because
> expected_args == 0 means that the caller is not interested in the argument
> vector, but it would be a potential problem if somebody wanted to add
> commands with optional arguments to qtest.
> 
> Suggested-by: Kamil Dudka <kdudka@redhat.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  tests/qtest/libqtest.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c
> index be0fb430dd..e49f3a1e45 100644
> --- a/tests/qtest/libqtest.c
> +++ b/tests/qtest/libqtest.c
> @@ -545,6 +545,7 @@ redo:
>          }
>      } else {
>          g_strfreev(words);
> +        words = NULL;
>      }
>  
>      return words;
> 

Reviewed-by: Thomas Huth <thuth@redhat.com>



  reply	other threads:[~2020-11-20 12:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-20  7:31 [PATCH] qtest: do not return freed argument vector from qtest_rsp Paolo Bonzini
2020-11-20 12:38 ` Thomas Huth [this message]
2020-11-20 13:09 ` Markus Armbruster

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=52f3190b-7a4a-046f-5708-c07093612895@redhat.com \
    --to=thuth@redhat.com \
    --cc=kdudka@redhat.com \
    --cc=pbonzini@redhat.com \
    --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 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.