From 98a4e5a301eb96b4d6c80b859e9986491e1eae06 Mon Sep 17 00:00:00 2001 From: Osier Yang Date: Wed, 16 Mar 2011 16:28:07 +0800 Subject: [PATCH] storage: Fix a problem which will cause libvirtd crashed If pool xml has no definition for "port", then "Segmentation fault" happens when jumping to "cleanup:" to do "VIR_FREE(port)", as "port" was not initialized in this situation. * src/conf/storage_conf.c --- src/conf/storage_conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index 6e3fe0e197..13a36229fe 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -396,7 +396,7 @@ virStoragePoolDefParseSource(xmlXPathContextPtr ctxt, char *authType = NULL; int nsource, i; virStoragePoolOptionsPtr options; - char *port; + char *port = NULL; relnode = ctxt->node; ctxt->node = node; -- GitLab