Im getting several errors in valgrind referring to one section of my code. Basically I have a linked list of structs that acts as a queue. Here is my enqueue function:
PcbPtr enqPcb(PcbPtr *headofQ, PcbPtr process){
PcbPtr c = *headofQ;
PcbPtr d = c;
if (!*headofQ) {
*headofQ = process;
return *headofQ;
}
while (c->next) {
c = c->next;
}
c->next = process;
return d;
}
PcbPtr is a pointer to the struct. Valgrind is giving me all sorts of stuff "Conditional jump or move depends on uninitialised value(s)" etc at the while loop. Its there anything noticeably wrong with this, or is beyond the scope of what Ive included? thanks