Thanks Maciej. I've sent out a patch v2 which fixes the memory leak.