tests: Don't call virNetServerClientClose without valid client

If @client hasn't been opened, then don't call virNetServerClientClose
since that'll cause certain failure.

Found by Coverity

Signed-off-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
John Ferlan 2018-04-02 07:19:38 -04:00
parent 713342e953
commit 6df5d77723

View File

@ -152,7 +152,8 @@ static int testIdentity(const void *opaque ATTRIBUTE_UNUSED)
ret = 0;
cleanup:
virObjectUnref(sock);
virNetServerClientClose(client);
if (!client)
virNetServerClientClose(client);
virObjectUnref(client);
virObjectUnref(ident);
VIR_FORCE_CLOSE(sv[0]);