alloc enough size for json file and use calloc.