diff --git a/src/rpc/virnetserver.c b/src/rpc/virnetserver.c index 242052754f7717709a418c4506c6c981009c95c1..07c8b85b76cbef303a558b778c548635231d7356 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 657108239fdc23873a571662718a8870cfefe919..756adcbb4f715f87af1025d40cb63034feee558d 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);