Fixing leaks

This was causing leaks every time an event is reported, leaking all the contents in those data structures, which ends up being a lot of memory
Merge pull request #12 from JaviSoto/patch-1

Fixing leaks