mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-30 09:53:10 +00:00
esx: Initialize all instances of esxVMX_Data to zero
To avoid using or freeing uninitialized memory or pointers.
This commit is contained in:
parent
b253452942
commit
38ea116eba
@ -2698,10 +2698,11 @@ esxDomainGetXMLDesc(virDomainPtr domain, unsigned int flags)
|
|||||||
char *vmx = NULL;
|
char *vmx = NULL;
|
||||||
virVMXContext ctx;
|
virVMXContext ctx;
|
||||||
esxVMX_Data data;
|
esxVMX_Data data;
|
||||||
data.datastorePathWithoutFileName = NULL;
|
|
||||||
virDomainDefPtr def = NULL;
|
virDomainDefPtr def = NULL;
|
||||||
char *xml = NULL;
|
char *xml = NULL;
|
||||||
|
|
||||||
|
memset(&data, 0, sizeof (data));
|
||||||
|
|
||||||
if (esxVI_EnsureSession(priv->primary) < 0) {
|
if (esxVI_EnsureSession(priv->primary) < 0) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -2805,6 +2806,8 @@ esxDomainXMLFromNative(virConnectPtr conn, const char *nativeFormat,
|
|||||||
virDomainDefPtr def = NULL;
|
virDomainDefPtr def = NULL;
|
||||||
char *xml = NULL;
|
char *xml = NULL;
|
||||||
|
|
||||||
|
memset(&data, 0, sizeof (data));
|
||||||
|
|
||||||
if (STRNEQ(nativeFormat, "vmware-vmx")) {
|
if (STRNEQ(nativeFormat, "vmware-vmx")) {
|
||||||
ESX_ERROR(VIR_ERR_INVALID_ARG,
|
ESX_ERROR(VIR_ERR_INVALID_ARG,
|
||||||
_("Unsupported config format '%s'"), nativeFormat);
|
_("Unsupported config format '%s'"), nativeFormat);
|
||||||
@ -2844,6 +2847,8 @@ esxDomainXMLToNative(virConnectPtr conn, const char *nativeFormat,
|
|||||||
virDomainDefPtr def = NULL;
|
virDomainDefPtr def = NULL;
|
||||||
char *vmx = NULL;
|
char *vmx = NULL;
|
||||||
|
|
||||||
|
memset(&data, 0, sizeof (data));
|
||||||
|
|
||||||
if (STRNEQ(nativeFormat, "vmware-vmx")) {
|
if (STRNEQ(nativeFormat, "vmware-vmx")) {
|
||||||
ESX_ERROR(VIR_ERR_INVALID_ARG,
|
ESX_ERROR(VIR_ERR_INVALID_ARG,
|
||||||
_("Unsupported config format '%s'"), nativeFormat);
|
_("Unsupported config format '%s'"), nativeFormat);
|
||||||
@ -3066,6 +3071,8 @@ esxDomainDefineXML(virConnectPtr conn, const char *xml)
|
|||||||
char *taskInfoErrorMessage = NULL;
|
char *taskInfoErrorMessage = NULL;
|
||||||
virDomainPtr domain = NULL;
|
virDomainPtr domain = NULL;
|
||||||
|
|
||||||
|
memset(&data, 0, sizeof (data));
|
||||||
|
|
||||||
if (esxVI_EnsureSession(priv->primary) < 0) {
|
if (esxVI_EnsureSession(priv->primary) < 0) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user