diff --git a/src/conf/virnetworkobj.c b/src/conf/virnetworkobj.c index 41a6c338093d540563019f8af11595a3683afe5f..d1636bcc1bc8bd66219fea8d1bd08bf118603a54 100644 --- a/src/conf/virnetworkobj.c +++ b/src/conf/virnetworkobj.c @@ -577,10 +577,10 @@ virNetworkObjAssignDefLocked(virNetworkObjListPtr nets, virUUIDFormat(def->uuid, uuidstr); if (virHashAddEntry(nets->objs, uuidstr, obj) < 0) goto cleanup; + virObjectRef(obj); obj->def = def; obj->persistent = !(flags & VIR_NETWORK_OBJ_LIST_ADD_LIVE); - virObjectRef(obj); } ret = obj;