mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
tools: remove unnecessary defaultConn variable
vshStrdup returns NULL without exiting on NULL input.
This commit is contained in:
parent
c0726e0708
commit
0855ef47dd
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user