From: John Ferlan Date: Fri, 6 Apr 2018 15:47:33 +0000 (-0400) Subject: conf: Use virDomainChrSourceDefNew for vhostuser X-Git-Tag: v4.3.0-rc1~377 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d6d8d7bb9aab90702d58114c9ec5a28c7329777c;p=thirdparty%2Flibvirt.git conf: Use virDomainChrSourceDefNew for vhostuser Rather than using VIR_ALLOC, use the New API since we already use the virDomainChrSourceDefFree function when done. Signed-off-by: John Ferlan Reviewed-by: Laine Stump Reviewed-by: Marc Hartmayer --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index aacd06a87a..caf3f47c63 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -11138,7 +11138,7 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt, goto error; } - if (VIR_ALLOC(def->data.vhostuser) < 0) + if (!(def->data.vhostuser = virDomainChrSourceDefNew(xmlopt))) goto error; def->data.vhostuser->type = VIR_DOMAIN_CHR_TYPE_UNIX;