Skip to content

Commit 076b70a

Browse files
committed
Use RedisModule_Calloc to allocate tensor blob.
1 parent 80c9906 commit 076b70a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/tensor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ RAI_Tensor *RAI_TensorCreateWithDLDataType(DLDataType dtype, long long *dims, in
123123
}
124124

125125
DLContext ctx = (DLContext){.device_type = kDLCPU, .device_id = 0};
126-
void *data = RedisModule_Alloc(len * dtypeSize);
126+
void *data = RedisModule_Calloc(len, dtypeSize);
127127

128128
ret->tensor = (DLManagedTensor){.dl_tensor = (DLTensor){.ctx = ctx,
129129
.data = data,

0 commit comments

Comments
 (0)