From a5493c47a01de22e24d2156a51a02d9299d4542c Mon Sep 17 00:00:00 2001 From: Marc Hartmayer Date: Thu, 14 Nov 2019 18:44:19 +0100 Subject: [PATCH] rpc: use the return value of virObjectRef directly Use the return value of virObjectRef directly. This way, it's easier for another reader to identify the reason why the additional reference is required. Signed-off-by: Marc Hartmayer Reviewed-by: John Ferlan Reviewed-by: Pavel Hrdina --- src/rpc/virnetserver.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/rpc/virnetserver.c b/src/rpc/virnetserver.c index 590e780b64..673bb7c10c 100644 --- a/src/rpc/virnetserver.c +++ b/src/rpc/virnetserver.c @@ -199,7 +199,7 @@ virNetServerDispatchNewMessage(virNetServerClientPtr client, if (VIR_ALLOC(job) < 0) goto error; - job->client = client; + job->client = virObjectRef(client); job->msg = msg; if (prog) { @@ -207,7 +207,6 @@ virNetServerDispatchNewMessage(virNetServerClientPtr client, priority = virNetServerProgramGetPriority(prog, msg->header.proc); } - virObjectRef(client); if (virThreadPoolSendJob(srv->workers, priority, job) < 0) { virObjectUnref(client); VIR_FREE(job); -- GitLab