daemon: don't free domain if it's null

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>
This commit is contained in:
Chen Hanxiao 2013-10-18 10:12:00 +08:00 committed by Ján Tomko
parent 0cacffac64
commit 8ebd3d8892

View File

@ -4643,7 +4643,8 @@ lxcDispatchDomainOpenNamespace(virNetServerPtr server ATTRIBUTE_UNUSED,
cleanup:
if (rv < 0)
virNetMessageSaveError(rerr);
virDomainFree(dom);
if (dom)
virDomainFree(dom);
return rv;
}