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

[libvirt] [PATCH 01/21] 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>
---
 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);
-- 
2.7.2


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