Re: [PATCH 01/21] admin: Make virAdmServerFree() handle NULL gracefully

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/03/16 05:53, Martin Kletzander wrote:
> We don't want to end up like with virDomainFree() and other, right?
> 
> Signed-off-by: Martin Kletzander <mkletzan@xxxxxxxxxx>
> ---
>  src/libvirt-admin.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/src/libvirt-admin.c b/src/libvirt-admin.c
> index 36674441b18b..54ae5ad3135e 100644
> --- a/src/libvirt-admin.c
> +++ b/src/libvirt-admin.c
> @@ -588,6 +588,10 @@ int virAdmServerFree(virAdmServerPtr srv)
>      VIR_DEBUG("server=%p", srv);
> 
>      virResetLastError();
> +
> +    if (!srv)
> +        return 0;
> +
>      virCheckAdmServerReturn(srv, -1);
> 
>      virObjectUnref(srv);
> 

ACK

Erik

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]