From ae6b47935d24a501c28c9c018ae9fb902242efc9 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Wed, 14 Sep 2022 17:56:27 -0700 Subject: [PATCH] sparse SparseMatrix_multiply3: use cgraph wrapper for allocation The lib/cgraph/alloc.h wrappers are similar to the older lib/common/memory.h wrappers except (1) they are header-only and (2) they live in a directory (cgraph) that is at the root of the dependency tree. The long term plan is to replace all use of lib/common/memory.h with lib/cgraph/alloc.h. --- lib/sparse/SparseMatrix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sparse/SparseMatrix.c b/lib/sparse/SparseMatrix.c index 64e5dccf4..253a3a3ec 100644 --- a/lib/sparse/SparseMatrix.c +++ b/lib/sparse/SparseMatrix.c @@ -1277,7 +1277,7 @@ SparseMatrix SparseMatrix_multiply3(SparseMatrix A, SparseMatrix B, SparseMatrix assert(type == MATRIX_TYPE_REAL); - mask = MALLOC(sizeof(int)*((size_t)(C->n))); + mask = calloc((size_t)C->n, sizeof(int)); if (!mask) return NULL; for (i = 0; i < C->n; i++) mask[i] = -1; -- 2.40.0