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(a)redhat.com>
---
tests/virnetserverclienttest.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tests/virnetserverclienttest.c b/tests/virnetserverclienttest.c
index 398b46928c..aa3f0bcf9b 100644
--- a/tests/virnetserverclienttest.c
+++ b/tests/virnetserverclienttest.c
@@ -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]);
--
2.13.6