comparison tests.c @ 710:c1c37f6ca133

Fix a silly memory leak in tests.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 27 Apr 2020 01:21:50 +0300
parents 905d30063e45
children 3ea040bb0dca
comparison
equal deleted inserted replaced
709:905d30063e45 710:c1c37f6ca133
602 for (const th_regex_match_t *mt = matches; 602 for (const th_regex_match_t *mt = matches;
603 mt != NULL; 603 mt != NULL;
604 mt = (th_regex_match_t *) mt->node.next, 604 mt = (th_regex_match_t *) mt->node.next,
605 nmatch++) 605 nmatch++)
606 { 606 {
607 char *match = th_strndup(str + mt->start, mt->len); 607 match = th_strndup(str + mt->start, mt->len);
608
608 if (expected[nmatch] == NULL) 609 if (expected[nmatch] == NULL)
609 { 610 {
610 if (!testOnly) 611 if (!testOnly)
611 { 612 {
612 THERR("Expected[%" PRIu_SIZE_T "] == NULL, but match '%s' returned.\n", 613 THERR("Expected[%" PRIu_SIZE_T "] == NULL, but match '%s' returned.\n",