Signed-off-by: Jan Vesely <[email protected]>
---
 tests/cl/program/program-tester.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/tests/cl/program/program-tester.c 
b/tests/cl/program/program-tester.c
index d6dbc55..3905679 100644
--- a/tests/cl/program/program-tester.c
+++ b/tests/cl/program/program-tester.c
@@ -517,13 +517,15 @@ regex_get_str(char** dst,
               unsigned int index,
               int cflags)
 {
-       regmatch_t pmatch[index+1];
+       regmatch_t *pmatch = calloc(index+1, sizeof(*pmatch));
+       bool ret = false;
 
        if(regex_get_matches(src, pattern, pmatch, index+1, cflags)) {
-               return regex_get_match_str(dst, src, pmatch, index);
+               ret = regex_get_match_str(dst, src, pmatch, index);
        }
 
-       return false;
+       free(pmatch);
+       return ret;
 }
 
 bool
-- 
2.1.0

_______________________________________________
Piglit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to