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

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

 



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@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

--
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]