]> xenbits.xensource.com Git - libvirt.git/commitdiff
Remove VIR_STRDUP usage that snuck in
authorJán Tomko <jtomko@redhat.com>
Thu, 24 Oct 2019 22:34:21 +0000 (00:34 +0200)
committerJán Tomko <jtomko@redhat.com>
Wed, 13 Nov 2019 16:01:38 +0000 (17:01 +0100)
Fixes: 224d269f19f0a6c496dd2218f934a54742d51708
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
src/qemu/qemu_domain.c

index 842b70dc26b695ecbf19fe2f8e10f1fa1cce32b6..54dde34f15b20e5965d0309afdbba9d50105fe46 100644 (file)
@@ -12843,8 +12843,7 @@ qemuDomainGetHostdevPath(virDomainDefPtr def,
             if (!usb)
                 goto cleanup;
 
-            if (VIR_STRDUP(tmpPath, virUSBDeviceGetPath(usb)) < 0)
-                goto cleanup;
+            tmpPath = g_strdup(virUSBDeviceGetPath(usb));
             perm = VIR_CGROUP_DEVICE_RW;
             break;
 
@@ -12865,8 +12864,7 @@ qemuDomainGetHostdevPath(virDomainDefPtr def,
                 if (!scsi)
                     goto cleanup;
 
-                if (VIR_STRDUP(tmpPath, virSCSIDeviceGetPath(scsi)) < 0)
-                    goto cleanup;
+                tmpPath = g_strdup(virSCSIDeviceGetPath(scsi));
                 perm = virSCSIDeviceGetReadonly(scsi) ?
                     VIR_CGROUP_DEVICE_READ : VIR_CGROUP_DEVICE_RW;
             }
@@ -12878,8 +12876,7 @@ qemuDomainGetHostdevPath(virDomainDefPtr def,
                 if (!(host = virSCSIVHostDeviceNew(hostsrc->wwpn)))
                     goto cleanup;
 
-                if (VIR_STRDUP(tmpPath, virSCSIVHostDeviceGetPath(host)) < 0)
-                    goto cleanup;
+                tmpPath = g_strdup(virSCSIVHostDeviceGetPath(host));
                 perm = VIR_CGROUP_DEVICE_RW;
             }
             break;