Remove the need for the @name variable by directly assigning
into source->hosts[i].name.
Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
int nsource;
size_t i;
virStoragePoolOptionsPtr options;
- char *name = NULL;
char *port = NULL;
char *ver = NULL;
int n;
source->nhost = n;
for (i = 0; i < source->nhost; i++) {
- name = virXMLPropString(nodeset[i], "name");
- if (name == NULL) {
+ source->hosts[i].name = virXMLPropString(nodeset[i], "name");
+ if (!source->hosts[i].name) {
virReportError(VIR_ERR_XML_ERROR, "%s",
_("missing storage pool host name"));
goto cleanup;
}
- source->hosts[i].name = name;
port = virXMLPropString(nodeset[i], "port");
if (port) {