Fixed a memory leak
Merge pull request #363 from telefonicaid/bug/leaks_at_error_and_tenants

Fixed a memory leak