free_mem(SearchNode *) now frees all the memory it's supposed to free