]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Properly check return value of VIR_STRDUP in qemuDomainGetBlockIoTune
authorPeter Krempa <pkrempa@redhat.com>
Tue, 23 May 2017 15:21:56 +0000 (17:21 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 24 May 2017 08:23:52 +0000 (10:23 +0200)
Setting the 'group_name' for a disk would falsely trigger a error path
as in commit 4b57f76502 we did not properly check the return value of
VIR_STRDUP.

src/qemu/qemu_driver.c

index 6c79d4fe319915cfc8cf1de325e299bf7aeb43ee..cd513ff9f832e68dab9b902d0028c79c8a10af7a 100644 (file)
@@ -17748,7 +17748,7 @@ qemuDomainGetBlockIoTune(virDomainPtr dom,
 
         /* Group name needs to be copied since qemuMonitorGetBlockIoThrottle
          * allocates it as well */
-        if (VIR_STRDUP(reply.group_name, disk->blkdeviotune.group_name))
+        if (VIR_STRDUP(reply.group_name, disk->blkdeviotune.group_name) < 0)
             goto endjob;
     }