Replace virNodeDeviceFree with virObjectUnref

Since virNodeDeviceFree will call virObjectUnref anyway, let's just use that
directly so as to avoid the possibility that we inadvertently clear out
a pending error message when using the public API.
This commit is contained in:
John Ferlan
2014-11-29 07:03:35 -05:00
parent 121c09a90b
commit e3b456de0f
4 changed files with 7 additions and 11 deletions

View File

@@ -3375,8 +3375,7 @@ remoteDispatchNodeDeviceGetParent(virNetServerPtr server ATTRIBUTE_UNUSED,
cleanup:
if (rv < 0)
virNetMessageSaveError(rerr);
if (dev)
virNodeDeviceFree(dev);
virObjectUnref(dev);
return rv;
}
@@ -4908,7 +4907,7 @@ remoteDispatchConnectListAllNodeDevices(virNetServerPtr server ATTRIBUTE_UNUSED,
virNetMessageSaveError(rerr);
if (devices && ndevices > 0) {
for (i = 0; i < ndevices; i++)
virNodeDeviceFree(devices[i]);
virObjectUnref(devices[i]);
VIR_FREE(devices);
}
return rv;