ccanlint: fix more potential segvs when reporting ccanlint errors.
[ccan] / tools / ccanlint / tests / tests_pass_valgrind.c
index da61dd364729daf87c42cbeb91fbe184e9069e0b..7ef0ac1aa9ac72809473befa118538580d820a1e 100644 (file)
@@ -127,7 +127,7 @@ static void do_run_tests_vg(struct manifest *m,
                                i->leak_info = get_leaks(output, &err);
                        }
                        if (err)
-                               score_file_error(score, i, 0, err);
+                               score_file_error(score, i, 0, "%s", err);
                        else
                                score->score++;
                }
@@ -149,7 +149,8 @@ static void do_leakcheck_vg(struct manifest *m,
        foreach_ptr(list, &m->run_tests, &m->api_tests) {
                list_for_each(list, i, list) {
                        if (i->leak_info) {
-                               score_file_error(score, i, 0, i->leak_info);
+                               score_file_error(score, i, 0, "%s",
+                                                i->leak_info);
                                leaks = true;
                        }
                }