[libvirt] [PATCH 2/5] commandtest: Resolve some coverity resource leaks

Eric Blake eblake at redhat.com
Fri Feb 15 13:17:24 UTC 2013


On 02/15/2013 02:01 AM, Peter Krempa wrote:

>> So, one could logically believe the check could change to:
>>
>>      sa_assert(fd == -1 || (fd >= 3 && fd <= 8));

Yes, I like that.

>>>> ACK with the assertion removed or a sufficient explanation provided.
> 
> I think this is a sufficient explanation, so ACK (as long as sa_assert
> has no side effects normally).

sa_assert is a no-op when static analysis is not being performed.
That's why we prefer it over raw assert(), because sa_assert() does not
change based on NDEBUG, only based on toolchain.

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130215/9735653e/attachment-0001.sig>


More information about the libvir-list mailing list