esxVI_FileQuery_DynamicCast(folderFileQuery)) < 0) {
goto cleanup;
}
+ folderFileQuery = NULL;
} else {
if (esxVI_VmDiskFileQuery_Alloc(&vmDiskFileQuery) < 0 ||
esxVI_VmDiskFileQueryFlags_Alloc(&vmDiskFileQuery->details) < 0 ||
vmDiskFileQuery->details->hardwareVersion = esxVI_Boolean_False;
vmDiskFileQuery->details->controllerType = esxVI_Boolean_True;
vmDiskFileQuery->details->diskExtents = esxVI_Boolean_False;
+ vmDiskFileQuery = NULL;
if (esxVI_IsoImageFileQuery_Alloc(&isoImageFileQuery) < 0 ||
esxVI_FileQuery_AppendToList
esxVI_FileQuery_DynamicCast(isoImageFileQuery)) < 0) {
goto cleanup;
}
+ isoImageFileQuery = NULL;
if (esxVI_FloppyImageFileQuery_Alloc(&floppyImageFileQuery) < 0 ||
esxVI_FileQuery_AppendToList
esxVI_FileQuery_DynamicCast(floppyImageFileQuery)) < 0) {
goto cleanup;
}
+ floppyImageFileQuery = NULL;
}
if (esxVI_String_Alloc(&searchSpec->matchPattern) < 0) {
VIR_FREE(taskInfoErrorMessage);
esxVI_TaskInfo_Free(&taskInfo);
esxVI_HostDatastoreBrowserSearchResults_Free(&searchResults);
+ esxVI_FolderFileQuery_Free(&folderFileQuery);
+ esxVI_VmDiskFileQuery_Free(&vmDiskFileQuery);
+ esxVI_IsoImageFileQuery_Free(&isoImageFileQuery);
+ esxVI_FloppyImageFileQuery_Free(&floppyImageFileQuery);
return result;
}
vmDiskFileQuery->details->hardwareVersion = esxVI_Boolean_False;
vmDiskFileQuery->details->controllerType = esxVI_Boolean_True;
vmDiskFileQuery->details->diskExtents = esxVI_Boolean_False;
+ vmDiskFileQuery = NULL;
if (esxVI_IsoImageFileQuery_Alloc(&isoImageFileQuery) < 0 ||
esxVI_FileQuery_AppendToList
esxVI_FileQuery_DynamicCast(isoImageFileQuery)) < 0) {
goto cleanup;
}
+ isoImageFileQuery = NULL;
if (esxVI_FloppyImageFileQuery_Alloc(&floppyImageFileQuery) < 0 ||
esxVI_FileQuery_AppendToList
esxVI_FileQuery_DynamicCast(floppyImageFileQuery)) < 0) {
goto cleanup;
}
+ floppyImageFileQuery = NULL;
/* Search datastore for files */
if (virAsprintf(&datastorePath, "[%s]", datastoreName) < 0)
esxVI_ManagedObjectReference_Free(&task);
VIR_FREE(taskInfoErrorMessage);
esxVI_TaskInfo_Free(&taskInfo);
+ esxVI_VmDiskFileQuery_Free(&vmDiskFileQuery);
+ esxVI_IsoImageFileQuery_Free(&isoImageFileQuery);
+ esxVI_FloppyImageFileQuery_Free(&floppyImageFileQuery);
return result;
}