[Piglit] [PATCH] CL: Fix memory leak in parse_name

Aaron Watry awatry at gmail.com
Mon Nov 11 06:43:56 PST 2013


We need to free a regex after compiling/executing it.
---
 tests/cl/program/program-tester.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/cl/program/program-tester.c b/tests/cl/program/program-tester.c
index be6bc20..31aeec9 100644
--- a/tests/cl/program/program-tester.c
+++ b/tests/cl/program/program-tester.c
@@ -1132,6 +1132,8 @@ parse_name(const char *input)
 							input, bad_char);
 		return NULL;
 	}
+
+	regfree(&regex);
 	return name;
 }
 
-- 
1.8.3.2



More information about the Piglit mailing list