Fix memory leak on error condition in events init
Merge pull request #225 from tklengyel/events_leak_fix

Fix memory leak on error condition in events init