[Piglit] [PATCH] cl-api-get-kernel-info: Fix possible use after free.

Vinson Lee vlee at freedesktop.org
Sat Feb 8 12:15:36 PST 2014


Fixes "Use after free" defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee at freedesktop.org>
---
 tests/cl/api/get-kernel-info.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/cl/api/get-kernel-info.c b/tests/cl/api/get-kernel-info.c
index a6718ca..b53fc6f 100644
--- a/tests/cl/api/get-kernel-info.c
+++ b/tests/cl/api/get-kernel-info.c
@@ -112,6 +112,7 @@ piglit_cl_test(const int argc,
 		//TODO: output returned values
 		printf("\n");
 		free(param_value);
+		param_value = NULL;
 	}
 
 	/*** Errors ***/
-- 
1.8.3.2



More information about the Piglit mailing list