Blob Blame History Raw
From f3e5eee71c29741d6d0230561fc1ceb26019629a Mon Sep 17 00:00:00 2001
Message-Id: <f3e5eee71c29741d6d0230561fc1ceb26019629a@dist-git>
From: Peter Krempa <pkrempa@redhat.com>
Date: Wed, 24 May 2017 12:48:06 +0200
Subject: [PATCH] qemu: Properly check return value of VIR_STRDUP in
 qemuDomainGetBlockIoTune

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.

(cherry picked from commit 3fe624b2689d825a47e86ae3fb9735313e9105c3)

https://bugzilla.redhat.com/show_bug.cgi?id=1433183

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
 src/qemu/qemu_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index a0f641fd4..3241de4cb 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -17750,7 +17750,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;
     }
 
-- 
2.13.0