[libvirt] [PATCH]daemon: don't free domain if it's null

Chen Hanxiao chenhanxiao at cn.fujitsu.com
Fri Oct 18 02:12:00 UTC 2013


From: Chen Hanxiao <chenhanxiao at cn.fujitsu.com>

If we fail to get domain, we had to judge whether
it's null or not when doing 'cleanup'.

Signed-off-by: Chen Hanxiao <chenhanxiao at cn.fujitsu.com>
---
 daemon/remote.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/daemon/remote.c b/daemon/remote.c
index f3de6a0..decaecc 100644
--- a/daemon/remote.c
+++ b/daemon/remote.c
@@ -4643,7 +4643,8 @@ lxcDispatchDomainOpenNamespace(virNetServerPtr server ATTRIBUTE_UNUSED,
 cleanup:
     if (rv < 0)
         virNetMessageSaveError(rerr);
-    virDomainFree(dom);
+    if (dom)
+        virDomainFree(dom);
     return rv;
 }
 
-- 
1.8.2.1




More information about the libvir-list mailing list