Re: [PATCH] lxcFreezeContainer: avoid test-after-deref of never-NULL pointer

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

 



On 05/17/2010 11:22 AM, Jim Meyering wrote:
> This addresses another coverity-spotted "flaw".
> However, since "cgroup" is never NULL after that initial "if" stmt,
> the only penalty is that the useless cleanup test would make a reviewer
> try to figure out how cgroup could be NULL there.

ACK.

> 
>  cleanup:
> -    if (cgroup)
> -        virCgroupFree(&cgroup);
> +    virCgroupFree(&cgroup);

Is this something that the useless-if-before-free test could have
caught, rather than waiting for coverity?

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-801-349-2682
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]