Fixed memory leak from usage of static function
Merge pull request #24 from codingthoughts/memory_leak_fix

Fixed memory leak from usage of static function