gfxstream: Use os_get_option_dup(VK_DRIVER_FILES)
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

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:
Yonggang Luo 2025-11-25 18:40:42 +08:00
parent d668c0ad42
commit 6356efc4e0

View file

@ -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();