From 568e6651ba55cb5d781edb80fd5ff2ebc94825df Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Thu, 28 Jun 2012 23:42:50 +0200 Subject: [PATCH] network_conf: Don't free uninitialized pointers while parsing DNS SRV If the user specified invalid protocol type in a network's SRV record the error path ended up in freeing uninitialized pointers causing a daemon crash. *network_conf.c: virNetworkDNSSrvDefParseXML(): initialize local variables (cherry picked from commit 96ebb4fe586512487f83b4696d20923315889796) --- src/conf/network_conf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c index 60cd888a4e..515bc36edc 100644 --- a/src/conf/network_conf.c +++ b/src/conf/network_conf.c @@ -574,10 +574,10 @@ virNetworkDNSSrvDefParseXML(virNetworkDNSDefPtr def, xmlNodePtr cur, xmlXPathContextPtr ctxt) { - char *domain; - char *service; - char *protocol; - char *target; + char *domain = NULL; + char *service = NULL; + char *protocol = NULL; + char *target = NULL; int port; int priority; int weight;