Rather than using VIR_ALLOC, use the New API since we already
use the virDomainChrSourceDefFree function when done.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
src/conf/domain_conf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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;
--
2.13.6