cap malloc from AM_json