[libvirt] [PATCH] qemu: avoid pass null pointer as an argument

Eric Blake eblake at redhat.com
Fri Aug 5 12:41:29 UTC 2011


On 08/04/2011 07:00 PM, Alex Jia wrote:
>> closelog:
>> - VIR_FREE(buf);
>> -
>> if (VIR_CLOSE(logfd) < 0) {
>> char ebuf[1024];
>> VIR_WARN("Unable to close logfile: %s",
>> virStrerror(errno, ebuf, sizeof ebuf));
>> }
>>
>> VIR_FREE(buf);
>>
> Right, this is a double free, Eric, Hasn't Coverity found this issue?

It's not a double free, since the first VIR_FREE sets buf to NULL, 
making the second one a no-op, which is why Coverity won't warn about it.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org




More information about the libvir-list mailing list