How to detect memory leaks as a new C programmer
<p>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. </p>

<p>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 ).</p>

<p>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.</p>