Re: [PATCH 7/9] qemu: Resolve Coverity FORWARD_NULL

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

 



On 09/11/2014 06:06 PM, John Ferlan wrote:
> If we end up at the cleanup lable before we've VIR_EXPAND_N the list,
> then calling virQEMUCapsFreeStringList() with a NULL proplist could
> theoretically deref proplist if nproplist was set. Coverity doesn't

Incomplete sentence.

> 
> Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
> ---
>  src/qemu/qemu_capabilities.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

ACK

> diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
> index a652f29..81ada48 100644
> --- a/src/qemu/qemu_capabilities.c
> +++ b/src/qemu/qemu_capabilities.c
> @@ -1728,7 +1728,7 @@ virQEMUCapsParseDeviceStrObjectProps(const char *str,
>      ret = nproplist;
>  
>   cleanup:
> -    if (ret < 0)
> +    if (ret < 0 && proplist)
>          virQEMUCapsFreeStringList(nproplist, proplist);
>      return ret;
>  }
> 

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

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]