int user_free_cg(void **user)
The user has to free all the data structures within user, and also free user itself. The user can use the built-in macro FREE that checks the existence of a pointer before freeing it.