]> xenbits.xensource.com Git - libvirt.git/commitdiff
conf: Fix leak in virNodeDeviceObjListExport
authorJohn Ferlan <jferlan@redhat.com>
Mon, 20 Feb 2017 19:03:07 +0000 (14:03 -0500)
committerJohn Ferlan <jferlan@redhat.com>
Tue, 21 Feb 2017 15:52:20 +0000 (10:52 -0500)
Fix a leak introduced by 4337bc57b when VIR_STRDUP'g the parent.

src/conf/node_device_conf.c

index 1c81b48053f3304bb97fc06368d9427ea72dbf43..c80284017ddca182701ed00b6471d8827d54ee48 100644 (file)
@@ -2288,6 +2288,7 @@ virNodeDeviceObjListExport(virConnectPtr conn,
             if (devices) {
                 if (!(device = virGetNodeDevice(conn, devobj->def->name)) ||
                     VIR_STRDUP(device->parent, devobj->def->parent) < 0) {
+                    virObjectUnref(device);
                     virNodeDeviceObjUnlock(devobj);
                     goto cleanup;
                 }