qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 10/13] qemu-config: fix leak in query-command


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v2 10/13] qemu-config: fix leak in query-command-line-options
Date: Fri, 15 Dec 2017 12:35:51 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0

On 12/15/2017 09:06 AM, Marc-André Lureau wrote:
> Direct leak of 160 byte(s) in 4 object(s) allocated from:
>     #0 0x55ed7678cda8 in calloc 
> (/home/elmarco/src/qq/build/x86_64-softmmu/qemu-system-x86_64+0x797da8)
>     #1 0x7f3f5e725f75 in g_malloc0 
> /home/elmarco/src/gnome/glib/builddir/../glib/gmem.c:124
>     #2 0x55ed778aa3a7 in query_option_descs 
> /home/elmarco/src/qq/util/qemu-config.c:60:16
>     #3 0x55ed778aa307 in get_drive_infolist 
> /home/elmarco/src/qq/util/qemu-config.c:140:19
>     #4 0x55ed778a9f40 in qmp_query_command_line_options 
> /home/elmarco/src/qq/util/qemu-config.c:254:36

> 
> Signed-off-by: Marc-André Lureau <address@hidden>
> ---
>  util/qemu-config.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/util/qemu-config.c b/util/qemu-config.c
> index 99b0e46fa3..029fec53a9 100644
> --- a/util/qemu-config.c
> +++ b/util/qemu-config.c
> @@ -105,7 +105,8 @@ static void cleanup_infolist(CommandLineParameterInfoList 
> *head)
>              if (!strcmp(pre_entry->value->name, cur->next->value->name)) {
>                  del_entry = cur->next;
>                  cur->next = cur->next->next;
> -                g_free(del_entry);
> +                del_entry->next = NULL;
> +                qapi_free_CommandLineParameterInfoList(del_entry);

Reviewed-by: Eric Blake <address@hidden>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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