I think free is working. I changed the line parser.y so now the ast global head pointer is working properly.