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
This commit is contained in:
Osier Yang 2011-03-16 16:28:07 +08:00
parent 100bba0647
commit 98a4e5a301

View File

@ -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;