Forces callers to use the virNetworkObjEndAPI properly.
Signed-off-by: John Ferlan <jferlan@redhat.com>
ignore_value(virBitmapSetBit(obj->classIdMap, 1));
ignore_value(virBitmapSetBit(obj->classIdMap, 2));
+ virObjectLock(obj);
+
return obj;
error:
if (!(obj = virNetworkObjNew()))
goto cleanup;
- virObjectLock(obj);
-
virUUIDFormat(def->uuid, uuidstr);
if (virHashAddEntry(nets->objs, uuidstr, obj) < 0)
goto cleanup;
VIR_FREE(actual);
VIR_FREE(pidfile);
virCommandFree(cmd);
- virObjectUnref(obj);
+ virNetworkObjEndAPI(&obj);
dnsmasqContextFree(dctx);
return ret;
}