From 1c888bade5f3ddb5ed23b9e37dae7089a63f1e50 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Mon, 19 Oct 2015 19:06:55 +0200 Subject: [PATCH] hyperv: Allocate 'def' via virDomainDefNew Use the helper that is necessary to fill out some values rather than allocating it directly. --- src/hyperv/hyperv_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hyperv/hyperv_driver.c b/src/hyperv/hyperv_driver.c index 1958bbe769..72261dfa32 100644 --- a/src/hyperv/hyperv_driver.c +++ b/src/hyperv/hyperv_driver.c @@ -774,7 +774,7 @@ hypervDomainGetXMLDesc(virDomainPtr domain, unsigned int flags) /* Flags checked by virDomainDefFormat */ - if (VIR_ALLOC(def) < 0) + if (!(def = virDomainDefNew())) goto cleanup; virUUIDFormat(domain->uuid, uuid_string);