diff --git a/src/gallium/drivers/d3d12/d3d12_screen.cpp b/src/gallium/drivers/d3d12/d3d12_screen.cpp index d30d1b4cce3..180053af988 100644 --- a/src/gallium/drivers/d3d12/d3d12_screen.cpp +++ b/src/gallium/drivers/d3d12/d3d12_screen.cpp @@ -1421,11 +1421,13 @@ try_create_device_factory(util_dl_library *d3d12_mod) /* It's possible there's a D3D12Core.dll next to the .exe, for development/testing purposes. If so, we'll be notified * by environment variables what the relative path is and the version to use. */ - const char *d3d12core_relative_path = getenv("D3D12_AGILITY_RELATIVE_PATH"); - const char *d3d12core_sdk_version = getenv("D3D12_AGILITY_SDK_VERSION"); + char *d3d12core_relative_path = os_get_option_dup("D3D12_AGILITY_RELATIVE_PATH"); + char *d3d12core_sdk_version = os_get_option_dup("D3D12_AGILITY_SDK_VERSION"); if (d3d12core_relative_path && d3d12core_sdk_version) { (void)sdk_config->SetSDKVersion(atoi(d3d12core_sdk_version), d3d12core_relative_path); } + free(d3d12core_relative_path); + free(d3d12core_sdk_version); sdk_config->Release(); } #endif diff --git a/src/microsoft/vulkan/dzn_device.c b/src/microsoft/vulkan/dzn_device.c index ed4ae15af2d..163168e4ba8 100644 --- a/src/microsoft/vulkan/dzn_device.c +++ b/src/microsoft/vulkan/dzn_device.c @@ -315,11 +315,13 @@ try_create_device_factory(struct util_dl_library *d3d12_mod) /* It's possible there's a D3D12Core.dll next to the .exe, for development/testing purposes. If so, we'll be notified * by environment variables what the relative path is and the version to use. */ - const char *d3d12core_relative_path = getenv("DZN_AGILITY_RELATIVE_PATH"); - const char *d3d12core_sdk_version = getenv("DZN_AGILITY_SDK_VERSION"); + char *d3d12core_relative_path = os_get_option_dup("DZN_AGILITY_RELATIVE_PATH"); + char *d3d12core_sdk_version = os_get_option_dup("DZN_AGILITY_SDK_VERSION"); if (d3d12core_relative_path && d3d12core_sdk_version) { ID3D12SDKConfiguration_SetSDKVersion(sdk_config, atoi(d3d12core_sdk_version), d3d12core_relative_path); } + free(d3d12core_relative_path); + free(d3d12core_sdk_version); ID3D12SDKConfiguration_Release(sdk_config); } #endif