When allocating memory for two different nodes, the resulting memory are the same. Clearly, this will lead to a mistake. This happened in a function. And the process must be in a function.
(gdb) p tree->list[9]
$43 = (node *) 0x8be4180
(gdb) p tree->list[10]
$44 = (node *) 0x8be4180
At the beginning, it is correct. list[0] to list[8] is allocated properly. But it can not work well in list[9]