diff --git a/src/rpc/virnetserver.c b/src/rpc/virnetserver.c index 091a1dc0bc..2af878977a 100644 --- a/src/rpc/virnetserver.c +++ b/src/rpc/virnetserver.c @@ -974,8 +974,10 @@ int virNetServerAddService(virNetServerPtr srv, if (!virNetServerMDNSAddEntry(srv->mdnsGroup, mdnsEntryName, - port)) + port)) { + srv->nservices--; goto error; + } } srv->services[srv->nservices-1] = svc;