提交 5ad03b9d 编写于 作者: J John Ferlan

conf: Fix leak in virNodeDeviceObjListExport

Fix a leak introduced by 4337bc57 when VIR_STRDUP'g the parent.
上级 0a6cb28b
...@@ -2288,6 +2288,7 @@ virNodeDeviceObjListExport(virConnectPtr conn, ...@@ -2288,6 +2288,7 @@ virNodeDeviceObjListExport(virConnectPtr conn,
if (devices) { if (devices) {
if (!(device = virGetNodeDevice(conn, devobj->def->name)) || if (!(device = virGetNodeDevice(conn, devobj->def->name)) ||
VIR_STRDUP(device->parent, devobj->def->parent) < 0) { VIR_STRDUP(device->parent, devobj->def->parent) < 0) {
virObjectUnref(device);
virNodeDeviceObjUnlock(devobj); virNodeDeviceObjUnlock(devobj);
goto cleanup; goto cleanup;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册