configurator: fix crash when more than one extra test provided
[ccan] / tools / configurator / configurator.c
index 1386fc90c8d72be6e734eb9f21a2d661b4c6f86c..f15f34483c36352549af73a9facea230ced71bfe 100644 (file)
@@ -888,7 +888,8 @@ static void read_tests(size_t num_tests)
 {
        while (read_test(tests + num_tests)) {
                num_tests++;
 {
        while (read_test(tests + num_tests)) {
                num_tests++;
-               tests = realloc(tests, num_tests * sizeof(tests[0]));
+               tests = realloc(tests, (num_tests + 1) * sizeof(tests[0]));
+               tests[num_tests].name = NULL;
        }
 }
 
        }
 }