From 8d68dd8188ee6e9a21d916462145fa35811835df Mon Sep 17 00:00:00 2001 From: Roland Winklmeier Date: Thu, 30 Oct 2014 16:52:37 +0100 Subject: [PATCH] refs #341 Allocate variables when they are needed the first time --- src/plugins/simulator/fs9/directplay_peer.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/plugins/simulator/fs9/directplay_peer.cpp b/src/plugins/simulator/fs9/directplay_peer.cpp index eca88ea8e..f50585f7b 100644 --- a/src/plugins/simulator/fs9/directplay_peer.cpp +++ b/src/plugins/simulator/fs9/directplay_peer.cpp @@ -199,12 +199,11 @@ namespace BlackSimPlugin bool CDirectPlayPeer::isServiceProviderValid(const GUID* /*pGuidSP*/) { - HRESULT hr = S_OK; DWORD dwItems = 0; DWORD dwSize = 0; // The first call is to retrieve the size of the DPN_SERVICE_PROVIDER_INFO array - hr = m_directPlayPeer->EnumServiceProviders(&CLSID_DP8SP_TCPIP, nullptr, nullptr, &dwSize, &dwItems, 0); + HRESULT hr = m_directPlayPeer->EnumServiceProviders(&CLSID_DP8SP_TCPIP, nullptr, nullptr, &dwSize, &dwItems, 0); if( hr != DPNERR_BUFFERTOOSMALL) {