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

From: Chen Hanxiao <chenhanxiao@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@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

On 10/18/2013 04:12 AM, Chen Hanxiao wrote:
From: Chen Hanxiao <chenhanxiao@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@cn.fujitsu.com> --- daemon/remote.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
ACK and pushed. Jan
participants (2)
-
Chen Hanxiao
-
Ján Tomko