diff --git a/src/rpc/virnetdaemon.c b/src/rpc/virnetdaemon.c index a6d6a4bd84467a33411d86014128cec21e237869..67dff147be605aaaee6fc2ab6f0986f2b5308e8a 100644 --- a/src/rpc/virnetdaemon.c +++ b/src/rpc/virnetdaemon.c @@ -162,7 +162,7 @@ virNetDaemonAddServer(virNetDaemonPtr dmn, virNetServerPtr srv) virObjectLock(dmn); - if (VIR_APPEND_ELEMENT(dmn->servers, dmn->nservers, srv) < 0) + if (VIR_APPEND_ELEMENT_COPY(dmn->servers, dmn->nservers, srv) < 0) goto cleanup; virObjectRef(srv);