void Vix_FreeBuffer(void *p);
When Vix_GetProperties() or Vix_JobWait() returns a string or blob property, it allocates a buffer for the data. Client applications are responsible for calling Vix_FreeBuffer() to free the buffer when no longer needed.
VixError err = VIX_OK;
VixHandle myVM = VIX_INVALID_HANDLE;
char *pathName;
int vmPowerState = 0;
// ...Open the virtual machine and get a handle...
err = Vix_GetProperties(myVM,
VIX_VM_VMX_PATHNAME,
&pathName,
VIX_VM_POWER_STATE_PROPERTY,
&vmPowerState,
VIX_PROPERTY_NONE);
if (VIX_OK != err) {
// Handle the error...
}
Vix_FreeBuffer(pathName);