mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
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:
parent
62b2c2fcdd
commit
28dd54a5b9
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user