I'm starting to learn C coming from a Java background. My first toy program is a binary search tree. I have implemented add, find, min, max, depthfirst and delete. My question stems from the delete method.
In order to debug I print the tree ( depth first ) to the console, then I remove nodes using delete and print the bst again. If it were Java I'd call it a day and move on but I'm worried that somewhere I forgot to free some memory ( or thought I did but free'd the wrong pointer or something ).
As a novice C programmer what is the best way to detect these sorts of memory leaks? I'm using CLion as my IDE if there are tools I should be using in the IDE but I would prefer some tricks that aren't IDE dependant.