Fix memory leak

Freeing a struct pointer isn't quite the same as freeing the memory pointed to by a field in the struct. Oops.