diff --git a/src/rpc/virnetserver.c b/src/rpc/virnetserver.c index 9d71e53698b29ed7aec10c03fe41e65e39bc2d07..247ddd75854b11bd601b202a5f4b7e7fb650dc08 100644 --- a/src/rpc/virnetserver.c +++ b/src/rpc/virnetserver.c @@ -759,15 +759,16 @@ void virNetServerQuit(virNetServerPtr srv) void virNetServerFree(virNetServerPtr srv) { int i; + int refs; if (!srv) return; virNetServerLock(srv); VIR_DEBUG("srv=%p refs=%d", srv, srv->refs); - srv->refs--; + refs = --srv->refs; virNetServerUnlock(srv); - if (srv->refs > 0) + if (refs > 0) return; for (i = 0 ; i < srv->nservices ; i++)