mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user