mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-25 10:03:49 +03:00
admin: Make virAdmServerFree() handle NULL gracefully
We don't want to end up like with virDomainFree() and other, right? Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
parent
ef2ab8fdc5
commit
23a646f840
@ -588,6 +588,10 @@ int virAdmServerFree(virAdmServerPtr srv)
|
|||||||
VIR_DEBUG("server=%p", srv);
|
VIR_DEBUG("server=%p", srv);
|
||||||
|
|
||||||
virResetLastError();
|
virResetLastError();
|
||||||
|
|
||||||
|
if (!srv)
|
||||||
|
return 0;
|
||||||
|
|
||||||
virCheckAdmServerReturn(srv, -1);
|
virCheckAdmServerReturn(srv, -1);
|
||||||
|
|
||||||
virObjectUnref(srv);
|
virObjectUnref(srv);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user