diff options
author | jvech <jmvalenciae@unal.edu.co> | 2024-09-08 09:25:50 -0500 |
---|---|---|
committer | jvech <jmvalenciae@unal.edu.co> | 2024-09-08 09:25:50 -0500 |
commit | f451cc936991e5095b1cb02262b5b0a9f12693f1 (patch) | |
tree | fb9718158d5222f2581cf93905e0de145444b43d | |
parent | a63ee8ba14aad0e364e928399b24196c72a4217f (diff) |
fix: memory leaks fixed
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Makefile | 7 | ||||
-rw-r--r-- | src/main.c | 2 | ||||
-rw-r--r-- | src/nn.c | 3 |
4 files changed, 13 insertions, 0 deletions
@@ -11,4 +11,5 @@ utils/*.gpi *.bin utils/*.py tests/*.png +leaks.log issues.txt @@ -61,5 +61,12 @@ debug: build gdb -x utils/commands.gdb --tui --args ${BIN} train data/xor.json -e 100 @#gdb -x utils/commands.gdb --tui --args ${BIN} predict data/sample_data.json +check_leaks: build + valgrind --leak-check=yes \ + --log-file=leaks.log \ + --leak-check=full \ + --show-leak-kinds=all \ + ./${BIN} train -c utils/settings.cfg data/xor.json + clean: @rm $(OBJDIR) -rv @@ -152,6 +152,8 @@ int main(int argc, char *argv[]) { nn_network_free_weights(network, ml_configs.network_size); free(network); + free(X.data); + free(y.data); util_free_config(&ml_configs); return 0; } @@ -170,6 +170,9 @@ void nn_network_train( free(weights); free(biases); + free(input_random); + free(labels_random); + return; nn_network_train_error: perror("nn_network_train() Error"); |