qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] QEMU Guest Agent: Fix memory leak of device inf


From: Marc-André Lureau
Subject: Re: [Qemu-devel] [PATCH] QEMU Guest Agent: Fix memory leak of device information set
Date: Tue, 13 Jun 2017 10:38:09 +0000

On Tue, Jun 13, 2017 at 2:23 PM Li Ping <address@hidden> wrote:

> The caller of SetupDiGetClassDevs must delete the returned device
> information
>  set when it is no longer needed by calling SetupDiDestroyDeviceInfoList.
>
> Signed-off-by: Li Ping<address@hidden>
>

Reviewed-by: Marc-André Lureau <address@hidden>



> ---
>  qga/commands-win32.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/qga/commands-win32.c b/qga/commands-win32.c
> index 439d229..6f16457 100644
> --- a/qga/commands-win32.c
> +++ b/qga/commands-win32.c
> @@ -512,7 +512,7 @@ static GuestPCIAddress *get_pci_info(char *guid, Error
> **errp)
>              } else {
>                  error_setg_win32(errp, GetLastError(),
>                          "failed to get device name");
> -                goto out;
> +                goto free_dev_info;
>              }
>          }
>
> @@ -560,6 +560,9 @@ static GuestPCIAddress *get_pci_info(char *guid, Error
> **errp)
>          pci->bus = bus;
>          break;
>      }
> +
> +free_dev_info:
> +    SetupDiDestroyDeviceInfoList(dev_info);
>  out:
>      g_free(buffer);
>      g_free(name);
> --
> 1.8.3.1
>
>
>
> --
Marc-André Lureau


reply via email to

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