vendor/scs/linsys/csparse.c in scs-0.3.1 vs vendor/scs/linsys/csparse.c in scs-0.3.2

- old
+ new

@@ -10,12 +10,12 @@ } /* out of memory */ A->m = m; /* define dimensions and nzmax */ A->n = n; A->nzmax = nzmax = MAX(nzmax, 1); A->nz = triplet ? 0 : -1; /* allocate triplet or comp.col */ - A->p = (scs_int *)scs_malloc((triplet ? nzmax : n + 1) * sizeof(scs_int)); - A->i = (scs_int *)scs_malloc(nzmax * sizeof(scs_int)); - A->x = values ? (scs_float *)scs_malloc(nzmax * sizeof(scs_float)) : SCS_NULL; + A->p = (scs_int *)scs_calloc((triplet ? nzmax : n + 1), sizeof(scs_int)); + A->i = (scs_int *)scs_calloc(nzmax, sizeof(scs_int)); + A->x = values ? (scs_float *)scs_calloc(nzmax, sizeof(scs_float)) : SCS_NULL; return (!A->p || !A->i || (values && !A->x)) ? SCS(cs_spfree)(A) : A; } csc *SCS(cs_done)(csc *C, void *w, void *x, scs_int ok) { scs_free(w); /* free workspace */