I\'m having some issues with producing an int matrix without creating memory leaks. I want to be able to make a given (global) matrix into any size dynamically via read_matr
You only freed the first row (or column) of first_matrix. Write another function like this:
void free_matrix(int **matrix, int rows) { int i; for(i=0; i<rows; i++) { free(matrix[i]); } free(matrix); }
You might want to make the matrix into a struct to store it's row and column count.