[Piglit] [PATCH 1/5] cl/program-tester: Make sure that platform_ids is initialized

Aaron Watry awatry at gmail.com
Fri Dec 23 04:10:35 UTC 2016


Otherwise, if you have ICDs installed and none successfully dlopen, you
end up freeing uninitialized/invalid memory.

Signed-off-by: Aaron Watry <awatry at gmail.com>

Discovered after an upgrade where I forgot to build mesa into clover, and
the nvidia icd was left around with no library to back it.
---
 tests/util/piglit-framework-cl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/util/piglit-framework-cl.c b/tests/util/piglit-framework-cl.c
index 9dc73c7..235f160 100644
--- a/tests/util/piglit-framework-cl.c
+++ b/tests/util/piglit-framework-cl.c
@@ -194,7 +194,7 @@ int piglit_cl_framework_run(int argc, char** argv)
 
 		bool platform_defined;
 		unsigned int num_platforms;
-		cl_platform_id* platform_ids;
+		cl_platform_id* platform_ids = NULL;
 
 		/* Create regexes */
 		if(   config->platform_regex != NULL
-- 
2.9.3



More information about the Piglit mailing list