Robert Shearman R.J.Shearman@warwick.ac.uk writes:
- struct list * pFreeList;
- struct list * pUsedList;
You are not using the list functions the right way; these should be a struct list, not a struct list *. The rest of the code then gets a lot cleaner, you don't need any special cases for empty lists etc.