/* Release the buffer in EFI_HII_VALUE if the buffer is not NULL. */
EFI_STATUS ReleaseHiiValue(IN EFI_HII_VALUE *HiiValue)
/* Release the buffer in EFI_HII_VALUE if the buffer is not NULL. */
EFI_STATUS ReleaseHiiValue(IN EFI_HII_VALUE *HiiValue)
{
  if (HiiValue == NULL) {
    return EFI_INVALID_PARAMETER;
  }
  if (HiiValue->Buffer == NULL) {
    return EFI_SUCCESS;
  }
  FreePool (HiiValue->Buffer);
  ZeroMem (HiiValue, sizeof (EFI_HII_VALUE));
  return EFI_SUCCESS;
}