update list.h

now with no mem leaks/errors