From 99114a62598d08699b8bd99c5777e6a662fb8562 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Tomko?= Date: Wed, 11 Dec 2019 14:00:27 +0100 Subject: [PATCH] Remove VIR_STRDUP usage that sneaked in in the meantime MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit My hesitation to remove VIR_STRDUP without VIR_STRNDUP resulted in these being able to sneak in. Signed-off-by: Ján Tomko Reviewed-by: Michal Privoznik --- src/conf/backup_conf.c | 4 +--- src/qemu/qemu_monitor_json.c | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/conf/backup_conf.c b/src/conf/backup_conf.c index 6be2e0498e..aa11967d2a 100644 --- a/src/conf/backup_conf.c +++ b/src/conf/backup_conf.c @@ -483,9 +483,7 @@ virDomainBackupAlignDisks(virDomainBackupDefPtr def, continue; backupdisk = &def->disks[ndisks++]; - - if (VIR_STRDUP(backupdisk->name, domdisk->dst) < 0) - return -1; + backupdisk->name = g_strdup(domdisk->dst); if (backup_all && !virStorageSourceIsEmpty(domdisk->src) && diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 00e1d3ce15..8a8347924a 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -5564,8 +5564,7 @@ int qemuMonitorJSONGetMachines(qemuMonitorPtr mon, goto cleanup; } - if (VIR_STRDUP(info->defaultCPU, tmp) < 0) - goto cleanup; + info->defaultCPU = g_strdup(tmp); } }