Fixed a bug where unallocated memory was beeing freed if connection to nagios server was lost