Did you fix these lines yet?
Code:
// in add
(*q) -> back -> next;
// in fetch
(*q) -> front -> next;
If you changed your gcc invocation in your makefile by adding -Wall to CFLAGS like this
Code:
CFLAGS = -Wall -o a.out
then the compiler would point out those lines automatically. It will also notify you that something is wrong with your fetch routine's return. Nifty.
(And why would you call your output a.out in a makefile? Still, that's your business.)
Presumably in
add you want
Code:
(*q) -> back -> next = temp;
I can't comprehend what
fetch is attemting to do.
EDIT: I took another peek at fetch and I get it now. But you presumably want to free(temp) and return fetch_data whether or not it's the last node being removed.