gfxstream: Use os_get_option_dup(VK_DRIVER_FILES)
As the return value os_get_option should be immediately consumed. Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Reviewed-by: Gurchetan Singh <gurchetansingh@google.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38687>
This commit is contained in:
@@ -208,7 +208,7 @@ GfxStreamVulkanMapper* GfxStreamVulkanMapper::getInstance(std::optional<DeviceId
|
||||
// testing, VK_DRIVER_FILES shouldn't be defined. For deqp-vk, this is
|
||||
// useful, but not safe for multi-threaded tests. For now, since this is only
|
||||
// used for end2end tests, we should be good.
|
||||
const char* driver = os_get_option(VK_DRIVER_FILES);
|
||||
char* driver = os_get_option_dup(VK_DRIVER_FILES);
|
||||
|
||||
// HACK: Need equivalents on Windows
|
||||
#if DETECT_OS_LINUX
|
||||
@@ -225,6 +225,7 @@ GfxStreamVulkanMapper* GfxStreamVulkanMapper::getInstance(std::optional<DeviceId
|
||||
setenv(VK_DRIVER_FILES, driver, 1);
|
||||
}
|
||||
#endif
|
||||
free(driver);
|
||||
}
|
||||
|
||||
return sVkMapper.get();
|
||||
|
||||
Reference in New Issue
Block a user