tools: remove unnecessary defaultConn variable

vshStrdup returns NULL without exiting on NULL input.
This commit is contained in:
Ján Tomko 2016-04-06 10:42:02 +02:00
parent c0726e0708
commit 0855ef47dd

View File

@ -908,7 +908,6 @@ main(int argc, char **argv)
{ {
vshControl _ctl, *ctl = &_ctl; vshControl _ctl, *ctl = &_ctl;
virshControl virshCtl; virshControl virshCtl;
const char *defaultConn;
bool ret = true; bool ret = true;
memset(ctl, 0, sizeof(vshControl)); memset(ctl, 0, sizeof(vshControl));
@ -977,8 +976,7 @@ main(int argc, char **argv)
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
if ((defaultConn = virGetEnvBlockSUID("VIRSH_DEFAULT_CONNECT_URI"))) ctl->connname = vshStrdup(ctl, virGetEnvBlockSUID("VIRSH_DEFAULT_CONNECT_URI"));
ctl->connname = vshStrdup(ctl, defaultConn);
if (!ctl->imode) { if (!ctl->imode) {
ret = vshCommandRun(ctl, ctl->cmd); ret = vshCommandRun(ctl, ctl->cmd);