diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2020-11-08 10:58:36 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2020-11-08 10:58:36 +0100 |
commit | b4158caf13bc715096c1df7c040c9d25995d76f2 (patch) | |
tree | a07d7d0764a8488f4b5ebef1561e2f3d8caacc05 /test/test_regset.c | |
parent | 0f259c3073f341c48468e80e93731daa31698030 (diff) | |
parent | fc9ba4264eafbb5a6ec0f3cc4cd2e1964c9b8fcf (diff) |
Update upstream source from tag 'upstream/6.9.6'
Update to upstream version '6.9.6'
with Debian dir 111ba939e0875272a460014bdcf030d413ce8f3f
Diffstat (limited to 'test/test_regset.c')
-rw-r--r-- | test/test_regset.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/test/test_regset.c b/test/test_regset.c index c8442a1..7476ec4 100644 --- a/test/test_regset.c +++ b/test/test_regset.c @@ -50,6 +50,7 @@ make_regset(int line_no, int n, char* pat[], OnigRegSet** rset, int error_no) nfail++; } } + onig_regset_free(set); return r; } @@ -96,6 +97,7 @@ time_test(int repeat, int n, char* ps[], char* s, char* end, double* rt_set, dou ONIG_REGSET_POSITION_LEAD, ONIG_OPTION_NONE, &match_pos); if (r < 0) { fprintf(stderr, "FAIL onig_regset_search(POSITION_LEAD): %d\n", r); + onig_regset_free(set); return r; } } @@ -109,6 +111,7 @@ time_test(int repeat, int n, char* ps[], char* s, char* end, double* rt_set, dou ONIG_REGSET_REGEX_LEAD, ONIG_OPTION_NONE, &match_pos); if (r < 0) { fprintf(stderr, "FAIL onig_regset_search(REGEX_LEAD): %d\n", r); + onig_regset_free(set); return r; } } @@ -158,7 +161,10 @@ time_compare(int n, char* ps[], char* s, char* end) for (i = 0; i < n; i++) { fisher_yates_shuffle(n, ps, cps); r = time_test(repeat, n, cps, s, end, &t_set, &t_reg); - if (r != 0) return ; + if (r != 0) { + free(cps); + return ; + } total_set += t_set; total_reg += t_reg; } @@ -231,6 +237,7 @@ xx(int line_no, int n, char* ps[], char* s, int from, int to, int mem, int not, if (region == 0) { fprintf(stderr, "ERROR: %d: can't get region.\n", line_no); nerror++; + onig_regset_free(set); return ; } @@ -285,7 +292,7 @@ n(int line_no, int n, char* ps[], char* s) static int get_all_content_of_file(char* path, char** rs, char** rend) { - size_t len; + ssize_t len; size_t n; char* line; FILE* fp; |