I wrote some C code to create a python module. I wrote the code myself (did not use SWIG etc). If you're interested, the C code is at the bottom of this thread.
Q: Is there any way to (hopefully, easily) find whether my C code has memory leaks? Is there any way to use python's awesomeness for finding memory leaks in its extensions?
sys.getrefcount(some_object)can be helpful for quick sanity checks (e.g. making sure that you don't accidentally increase the refcount of an input object to your function unexpectedly) -- But it isn't a substitute for a leak detecting tool like valgrind.