Conditional jump or move depends on uninitialised value - freeing a linked list
- by user720491
I want to free a linked list in C. All is working fine, but Valgrind is telling me
Conditional jump or move depends on uninitialised value(s)
at 0x401400: mtf_destroy
Here's the code:
list_elt *head;
void mtf_init() {
list_elt *current;
head = malloc(sizeof(list_elt));
current = head;
for (int i = 0; i < LIST_SIZE-1;…