X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=tools%2Fccanlint%2Ftests%2Ftests_pass_valgrind.c;h=4c4338b6c1c6d3ab20ad9e93a61cdf3da8361c78;hb=100444225380d3f5ca29424ea54703d308c7c651;hp=6bb27e875a8976133e988792ef361e76bf090e28;hpb=0f76c8b33771d01df2ce92974b88a69840bed321;p=ccan-lca-2011.git diff --git a/tools/ccanlint/tests/tests_pass_valgrind.c b/tools/ccanlint/tests/tests_pass_valgrind.c index 6bb27e8..4c4338b 100644 --- a/tools/ccanlint/tests/tests_pass_valgrind.c +++ b/tools/ccanlint/tests/tests_pass_valgrind.c @@ -52,11 +52,11 @@ static bool blank_line(const char *line) static char *get_leaks(const char *output, char **errs) { char *leaks = talloc_strdup(output, ""); - unsigned int i, num; - char **lines = strsplit(output, output, "\n", &num); + unsigned int i; + char **lines = strsplit(output, output, "\n"); *errs = talloc_strdup(output, ""); - for (i = 0; i < num; i++) { + for (i = 0; i < talloc_array_length(lines) - 1; i++) { if (strstr(lines[i], " lost ")) { /* A leak... */ if (strstr(lines[i], " definitely lost ")) { @@ -121,6 +121,7 @@ static void do_run_tests_vg(struct manifest *m, output = grab_file(i, "valgrind.log", NULL); if (!output || output[0] == '\0') { err = NULL; + i->leak_info = NULL; } else { i->leak_info = get_leaks(output, &err); }