Since it's introduction in v0.9.7-147-gf4324e3292 the
virNetServerClientInitKeepAlive() function returned nothing than
a negative one. Fortunately, this did not pose any problem
because we ignored the retval happily. Well, it's time to check
for the retval because the function might fail regularly.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/rpc/virnetserver.c | 5 +++--
src/rpc/virnetserverclient.c | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/rpc/virnetserver.c b/src/rpc/virnetserver.c
index 242052754f..07c8b85b76 100644
--- a/src/rpc/virnetserver.c
+++ b/src/rpc/virnetserver.c
@@ -306,8 +306,9 @@ int virNetServerAddClient(virNetServerPtr srv,
virNetServerDispatchNewMessage,
srv);
- virNetServerClientInitKeepAlive(client, srv->keepaliveInterval,
- srv->keepaliveCount);
+ if (virNetServerClientInitKeepAlive(client, srv->keepaliveInterval,
+ srv->keepaliveCount) < 0)
+ goto error;
virObjectUnlock(srv);
return 0;
diff --git a/src/rpc/virnetserverclient.c b/src/rpc/virnetserverclient.c
index 657108239f..756adcbb4f 100644
--- a/src/rpc/virnetserverclient.c
+++ b/src/rpc/virnetserverclient.c
@@ -1599,7 +1599,7 @@ virNetServerClientInitKeepAlive(virNetServerClientPtr client,
virObjectRef(client);
client->keepalive = ka;
-
+ ret = 0;
cleanup:
virObjectUnlock(client);
--
2.26.2