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

Re: [libvirt] [PATCH 1/3] avoid closing uninitialized fd



On 05/30/2012 03:20 AM, Wen Congyang wrote:
> If the system does not support bypass cache, we will close fd,
> but it is uninitialized.
> 
> ---
>  src/qemu/qemu_driver.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> index fea9c24..1b3391b 100644
> --- a/src/qemu/qemu_driver.c
> +++ b/src/qemu/qemu_driver.c
> @@ -4010,7 +4010,7 @@ qemuDomainSaveImageOpen(struct qemud_driver *driver,
>                          const char *xmlin, int state, bool edit,
>                          bool unlink_corrupt)
>  {
> -    int fd;
> +    int fd = -1;
>      struct qemud_save_header header;
>      char *xml = NULL;
>      virDomainDefPtr def = NULL;

ACK.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


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