You can just use calloc instead of this.