]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Resolve Coverity complaints in tests/securityselinuxlabeltest.c
authorJohn Ferlan <jferlan@redhat.com>
Wed, 3 Jul 2013 13:14:33 +0000 (09:14 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Mon, 8 Jul 2013 11:03:21 +0000 (07:03 -0400)
commita443c3a77a82bfa8cdc332a45263ddba17dc91ef
tree3e0c8e76e45703131fa0fdac3468cf2bcad54cb5
parent59cc0fe5aa00d472bdd19bfb40be219249cfd0c7
Resolve Coverity complaints in tests/securityselinuxlabeltest.c

Two complaints of RESOURCE_FREE due to going to cleanup prior to a
VIR_FREE(line).  Two complaints of FORWARD_NULL due to 'tmp' being
accessed after a strchr() without first checking if the return was NULL.

While looking at the code it seems that 'line' need only be allocated
once as the while loop will keep reading into line until eof causing
an unreported leak since line was never VIR_FREE()'d at the bottom of
the loop.
tests/securityselinuxlabeltest.c