On 12/12/14 19:33, Jan Vesely wrote:
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
Reviewed-by: Jose Fonseca <[email protected]> _______________________________________________ Piglit mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/piglit
