qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 07/20] qtest: add in-process incoming command handler


From: Stefan Hajnoczi
Subject: Re: [PATCH v4 07/20] qtest: add in-process incoming command handler
Date: Wed, 6 Nov 2019 17:33:09 +0100
User-agent: Mutt/1.12.1 (2019-06-15)

On Wed, Oct 30, 2019 at 02:49:53PM +0000, Oleinik, Alexander wrote:
> diff --git a/qtest.c b/qtest.c
> index ae7e6d779d..9fbfa0f08f 100644
> --- a/qtest.c
> +++ b/qtest.c
> @@ -802,3 +802,16 @@ bool qtest_driver(void)
>  {
>      return qtest_chr.chr != NULL;
>  }
> +
> +void qtest_server_inproc_recv(void *dummy, const char *buf, size_t size)
> +{
> +    static GString *gstr;
> +    if (!gstr) {
> +        gstr = g_string_new(NULL);
> +    }
> +    g_string_append(gstr, buf);
> +    if (gstr->str[gstr->len - 1] == '\n') {
> +        qtest_process_inbuf(NULL, gstr);
> +        g_string_free(gstr, true);

This double-frees gstr.  Please add:

  gstr = NULL;

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]