Cでリンクリストを解放したいのですが、すべて正常に機能していますが、Valgrindが教えてくれます
Conditional jump or move depends on uninitialised value(s)
at 0x401400: mtf_destroy
コードは次のとおりです。
list_elt *head;
void mtf_init() {
list_elt *current;
head = malloc(sizeof(list_elt));
current = head;
for (int i = 0; i < LIST_SIZE-1; i++) {
current->value = (BYTE) i;
current->next = malloc(sizeof(list_elt));
current = current->next;
}
current->value = LIST_SIZE-1;
}
void mtf_destroy(list_elt *elt) {
if (elt->next != NULL)
mtf_destroy(elt->next);
free(elt);
}
どうすればこれを解決できますか?ありがとう!