aboutsummaryrefslogtreecommitdiffstats
path: root/src/loader/loader.c
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2020-01-29 07:50:16 -0800
committerKenneth Graunke <[email protected]>2020-01-30 10:08:17 -0800
commit594cb3035615b3a6cf3dc09ccee30554b56eb2f3 (patch)
treeebbc385026ef1fd1b7efaf9b9f7b9b8bb7007dc0 /src/loader/loader.c
parentf09c466732e4a5b648d7503787777c926dd93c29 (diff)
loader: Fix leak of kernel driver name
This is strdup'd, it needs to be freed. CID: 1458032 Fixes: f93bb2fb102 ("loader: Check if the kernel driver is i915 before loading iris") Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Sagar Ghuge <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3630> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3630>
Diffstat (limited to 'src/loader/loader.c')
-rw-r--r--src/loader/loader.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/loader/loader.c b/src/loader/loader.c
index a2fe0a241a2..c896fdc3360 100644
--- a/src/loader/loader.c
+++ b/src/loader/loader.c
@@ -118,7 +118,10 @@ bool
is_kernel_i915(int fd)
{
char *kernel_driver = loader_get_kernel_driver_name(fd);
- return kernel_driver && strcmp(kernel_driver, "i915") == 0;
+ bool is_i915 = kernel_driver && strcmp(kernel_driver, "i915") == 0;
+
+ free(kernel_driver);
+ return is_i915;
}
#if defined(HAVE_LIBDRM)