replace malloc+memset with a call to ast_calloc, also removing the error