提交 97a84a93 编写于 作者: M Martin Kletzander

vmware: Fix some initialization problems

Don't leak guest if adding it to virCapabilities fails.  Also return
NULL and not pointer to free'd object with zero references in such
case.
Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
上级 e8e9a7e9
......@@ -105,14 +105,15 @@ vmwareCapsInit(void)
VIR_DOMAIN_VIRT_VMWARE,
NULL, NULL, 0, NULL) == NULL)
goto error;
guest = NULL;
}
cleanup:
return caps;
error:
virCapabilitiesFreeGuest(guest);
virObjectUnref(caps);
goto cleanup;
return NULL;
}
int
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册