From: Peter Krempa Date: Mon, 19 Oct 2015 17:06:55 +0000 (+0200) Subject: hyperv: Allocate 'def' via virDomainDefNew X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=1c888bade5f3ddb5ed23b9e37dae7089a63f1e50;p=libvirt.git hyperv: Allocate 'def' via virDomainDefNew Use the helper that is necessary to fill out some values rather than allocating it directly. --- 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);