We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 83feb1c commit cc18da1Copy full SHA for cc18da1
src/Layers/dense.c
@@ -40,6 +40,8 @@ int initialize_dense(DenseLayer *layer, int input_size, int output_size)
40
if (layer->weights == (void *)CM_MEMORY_ALLOCATION_ERROR || layer->biases == (void *)CM_MEMORY_ALLOCATION_ERROR)
41
{
42
fprintf(stderr, "[initializeDense] Error: Memory allocation failed.\n");
43
+ cm_safe_free((void **)&layer->weights);
44
+ cm_safe_free((void **)&layer->biases);
45
return CM_MEMORY_ALLOCATION_ERROR;
46
}
47
0 commit comments