mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +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;
|
||||
virshControl virshCtl;
|
||||
const char *defaultConn;
|
||||
bool ret = true;
|
||||
|
||||
memset(ctl, 0, sizeof(vshControl));
|
||||
@ -977,8 +976,7 @@ main(int argc, char **argv)
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if ((defaultConn = virGetEnvBlockSUID("VIRSH_DEFAULT_CONNECT_URI")))
|
||||
ctl->connname = vshStrdup(ctl, defaultConn);
|
||||
ctl->connname = vshStrdup(ctl, virGetEnvBlockSUID("VIRSH_DEFAULT_CONNECT_URI"));
|
||||
|
||||
if (!ctl->imode) {
|
||||
ret = vshCommandRun(ctl, ctl->cmd);
|
||||
|
Loading…
Reference in New Issue
Block a user