]> xenbits.xensource.com Git - libvirt.git/commitdiff
conf: Use virDomainChrSourceDefNew for vhostuser
authorJohn Ferlan <jferlan@redhat.com>
Fri, 6 Apr 2018 15:47:33 +0000 (11:47 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Tue, 10 Apr 2018 12:11:09 +0000 (08:11 -0400)
Rather than using VIR_ALLOC, use the New API since we already
use the virDomainChrSourceDefFree function when done.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Laine Stump <laine@laine.org>
Reviewed-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
src/conf/domain_conf.c

index aacd06a87a0e982902b7a95f0f74d8c7c4497967..caf3f47c6304604f171515d528e2eebdf14a6e48 100644 (file)
@@ -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;