From 84fb7219fb806947e0dc9305c762d25ef2a29094 Mon Sep 17 00:00:00 2001 From: Niklas Wolf Date: Mon, 10 Nov 2025 15:47:48 +0100 Subject: [PATCH] clear matrix --- matrix.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/matrix.c b/matrix.c index ad00628..f5a0b83 100644 --- a/matrix.c +++ b/matrix.c @@ -11,7 +11,11 @@ Matrix createMatrix(unsigned int rows, unsigned int cols) void clearMatrix(Matrix *matrix) { + free(matrix->data); + matrix->rows = 0; + matrix->cols = 0; + matrix->data = NULL; } void setMatrixAt(MatrixType value, Matrix matrix, unsigned int rowIdx, unsigned int colIdx)