From: Ján Tomko Date: Wed, 11 Dec 2019 13:00:27 +0000 (+0100) Subject: Remove VIR_STRDUP usage that sneaked in in the meantime X-Git-Tag: v6.0.0-rc1~342 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=99114a62598d08699b8bd99c5777e6a662fb8562;p=thirdparty%2Flibvirt.git Remove VIR_STRDUP usage that sneaked in in the meantime 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 --- 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); } }