mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-08 12:41:29 +00:00
tools: virsh-domain: Remove redundant conditional before virshDomainFree
virshDomainFree handles NULL pointers gracefully, so there's no need to check the pointer before the call. Signed-off-by: Yi Li <yili@winhong.com> Reviewed-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
parent
b4c0fcd5cc
commit
b1f10ed031
@ -1610,10 +1610,8 @@ virshDomainListFree(virshDomainListPtr domlist)
|
|||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
if (domlist && domlist->domains) {
|
if (domlist && domlist->domains) {
|
||||||
for (i = 0; i < domlist->ndomains; i++) {
|
for (i = 0; i < domlist->ndomains; i++)
|
||||||
if (domlist->domains[i])
|
virshDomainFree(domlist->domains[i]);
|
||||||
virshDomainFree(domlist->domains[i]);
|
|
||||||
}
|
|
||||||
VIR_FREE(domlist->domains);
|
VIR_FREE(domlist->domains);
|
||||||
}
|
}
|
||||||
VIR_FREE(domlist);
|
VIR_FREE(domlist);
|
||||||
|
@ -5509,8 +5509,7 @@ doDump(void *opaque)
|
|||||||
pthread_sigmask(SIG_SETMASK, &oldsigmask, NULL);
|
pthread_sigmask(SIG_SETMASK, &oldsigmask, NULL);
|
||||||
out_sig:
|
out_sig:
|
||||||
#endif /* !WIN32 */
|
#endif /* !WIN32 */
|
||||||
if (dom)
|
virshDomainFree(dom);
|
||||||
virshDomainFree(dom);
|
|
||||||
g_main_loop_quit(data->eventLoop);
|
g_main_loop_quit(data->eventLoop);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user