Check what we are freeing before we free it

parser could be NULL or parser->state could be NULL. You would get some fun
errors if that happened
Update generated C