conf: Fix libvirtd free() segfault if virDomainChrSourceDefNew(...) fails

If virDomainChrSourceDefNew(xmlopt) fails, it will lead to free()ing
the uninitialized pointer bus. The fix for this is to initialize bus
with NULL.

Signed-off-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
This commit is contained in:
Marc Hartmayer 2017-02-09 15:13:36 +01:00 committed by Laine Stump
parent 62b2c2fcdd
commit 28dd54a5b9

View File

@ -13317,7 +13317,7 @@ virDomainRedirdevDefParseXML(virDomainXMLOptionPtr xmlopt,
{
xmlNodePtr cur;
virDomainRedirdevDefPtr def;
char *bus, *type = NULL;
char *bus = NULL, *type = NULL;
int remaining;
if (VIR_ALLOC(def) < 0)