ccanlint: fix uninitialized variables in tests_pass_valgrind.
authorRusty Russell <rusty@rustcorp.com.au>
Tue, 1 Nov 2011 23:04:29 +0000 (09:34 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 1 Nov 2011 23:04:29 +0000 (09:34 +1030)
We weren't initializing the leak_info field when the test was marked
FAIL in _info (as in tdb2).

tools/ccanlint/tests/tests_pass_valgrind.c

index 818143777e2571e934bc59e98d215a1b3bf7bfcf..bf914856845f2a7a42e9cec97d210c9b7c3ef06a 100644 (file)
@@ -165,8 +165,10 @@ static void do_run_tests_vg(struct manifest *m,
                        options = concat(score,
                                         per_file_options(&tests_pass_valgrind,
                                                          i));
                        options = concat(score,
                                         per_file_options(&tests_pass_valgrind,
                                                          i));
-                       if (streq(options, "FAIL"))
+                       if (streq(options, "FAIL")) {
+                               i->leak_info = NULL;
                                continue;
                                continue;
+                       }
 
                        if (keep)
                                talloc_set_destructor(i->valgrind_log, NULL);
 
                        if (keep)
                                talloc_set_destructor(i->valgrind_log, NULL);