diff --git a/src/XrdCl/XrdClAsyncSocketHandler.cc b/src/XrdCl/XrdClAsyncSocketHandler.cc index 8a18e201f9a..9bb3cc792d4 100644 --- a/src/XrdCl/XrdClAsyncSocketHandler.cc +++ b/src/XrdCl/XrdClAsyncSocketHandler.cc @@ -954,6 +954,9 @@ namespace XrdCl // called from inside of Stream::OnReadTimeout, this // in turn means that the ownership of following // pointers, has been transfered to the inQueue + if( !pIncHandler.second ) + delete pIncoming; + pIncoming = 0; pOutgoing = 0; pOutHandler = 0; diff --git a/src/XrdCl/XrdClFileSystem.cc b/src/XrdCl/XrdClFileSystem.cc index 482de96cbfd..58b61307e53 100644 --- a/src/XrdCl/XrdClFileSystem.cc +++ b/src/XrdCl/XrdClFileSystem.cc @@ -692,11 +692,11 @@ namespace XrdCl { HostList::reverse_iterator it; for( it = hostList->rbegin(); it != hostList->rend(); ++it ) - if( it->loadBalancer ) - { - pFS->AssignLoadBalancer( it->url ); - break; - } + if( it->loadBalancer ) + { + pFS->AssignLoadBalancer( it->url ); + break; + } } pUserHandler->HandleResponseWithHosts( status, response, hostList ); delete this; diff --git a/src/XrdCl/XrdClInQueue.cc b/src/XrdCl/XrdClInQueue.cc index 11fcc43f44d..e40cf69cad9 100644 --- a/src/XrdCl/XrdClInQueue.cc +++ b/src/XrdCl/XrdClInQueue.cc @@ -83,7 +83,7 @@ namespace XrdCl action = handler->Examine( msg ); if( action & IncomingMsgHandler::RemoveHandler ) - pHandlers.erase( it ); + pHandlers.erase( it ); } if( !(action & IncomingMsgHandler::Take) ) @@ -113,10 +113,10 @@ namespace XrdCl if( action & IncomingMsgHandler::Take ) { - if( !(action & IncomingMsgHandler::NoProcess ) ) - handler->Process( it->second ); + if( !(action & IncomingMsgHandler::NoProcess ) ) + handler->Process( it->second ); - pMessages.erase( it ); + pMessages.erase( it ); } } @@ -152,7 +152,7 @@ namespace XrdCl exp = it->second.second; if( act & IncomingMsgHandler::Take ) - pHandlers.erase( it ); + pHandlers.erase( it ); } if( handler ) @@ -199,9 +199,9 @@ namespace XrdCl action = it->second.first->OnStreamEvent( event, streamNum, status ); if( action & IncomingMsgHandler::RemoveHandler ) - pHandlers.erase( it++ ); + pHandlers.erase( it++ ); else - ++it; + ++it; } } @@ -219,12 +219,12 @@ namespace XrdCl { if( it->second.second <= now ) { - it->second.first->OnStreamEvent( IncomingMsgHandler::Timeout, 0, - Status( stError, errOperationExpired ) ); - pHandlers.erase( it++ ); + it->second.first->OnStreamEvent( IncomingMsgHandler::Timeout, 0, + Status( stError, errOperationExpired ) ); + pHandlers.erase( it++ ); } else - ++it; + ++it; } } }