diff --git a/src/AspNetCore/Inc/applicationmanager.h b/src/AspNetCore/Inc/applicationmanager.h index 3a6f934113..41163a66b6 100644 --- a/src/AspNetCore/Inc/applicationmanager.h +++ b/src/AspNetCore/Inc/applicationmanager.h @@ -66,6 +66,13 @@ public: delete m_pFileWatcher; m_pFileWatcher = NULL; } + + if(m_pHttp502ErrorPage != NULL) + { + delete m_pHttp502ErrorPage; + m_pHttp502ErrorPage = NULL; + } + } FILE_WATCHER* diff --git a/src/AspNetCore/Src/applicationmanager.cxx b/src/AspNetCore/Src/applicationmanager.cxx index 75c4d3d12e..b99d645e41 100644 --- a/src/AspNetCore/Src/applicationmanager.cxx +++ b/src/AspNetCore/Src/applicationmanager.cxx @@ -151,6 +151,10 @@ APPLICATION_MANAGER::Get502ErrorPage( pHttp502ErrorPage->FromMemory.pBuffer = (PVOID)m_pstrErrorInfo; pHttp502ErrorPage->FromMemory.BufferLength = (ULONG)strnlen(m_pstrErrorInfo, maxsize); //(ULONG)(wcslen(m_pstrErrorInfo)); // *sizeof(WCHAR); + if(m_pHttp502ErrorPage != NULL) + { + delete m_pHttp502ErrorPage; + } m_pHttp502ErrorPage = pHttp502ErrorPage; *ppErrorPage = m_pHttp502ErrorPage; } diff --git a/src/AspNetCore/Src/serverprocess.cxx b/src/AspNetCore/Src/serverprocess.cxx index 3b8c9c5252..de3ea301ca 100644 --- a/src/AspNetCore/Src/serverprocess.cxx +++ b/src/AspNetCore/Src/serverprocess.cxx @@ -129,7 +129,7 @@ SERVER_PROCESS::StartProcess( WCHAR* pszPath = NULL; WCHAR pszFullPath[_MAX_PATH]; LPCWSTR apsz[1]; - PCWSTR pszAppPath = NULL; + PCWSTR pszAppPath = NULL; GetStartupInfoW(&startupInfo); @@ -457,8 +457,11 @@ SERVER_PROCESS::StartProcess( while (*(pszCurrentEnvironment + dwCurrentEnvSize++) != 0); } while (*(pszCurrentEnvironment + dwCurrentEnvSize++) != 0); - mszNewEnvironment.Append(pszCurrentEnvironment, dwCurrentEnvSize + 1 ); - + DBG_ASSERT(dwCurrentEnvSize > 0); + // + // environment block ends with \0\0, we don't want include the last \0 for appending + // + mszNewEnvironment.Append(pszCurrentEnvironment, dwCurrentEnvSize-1 ); dwCreationFlags = CREATE_NO_WINDOW | CREATE_UNICODE_ENVIRONMENT | diff --git a/src/IISLib/multisz.cpp b/src/IISLib/multisz.cpp index d8a4c1d0a6..d7ae9f3fdb 100644 --- a/src/IISLib/multisz.cpp +++ b/src/IISLib/multisz.cpp @@ -1,6 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. + +#pragma warning (disable : 4267) + #include "precomp.h" #include "multisz.h" #include @@ -467,3 +470,5 @@ Finished: return hr; } + +#pragma warning(default:4267) \ No newline at end of file diff --git a/src/IISLib/multisza.cpp b/src/IISLib/multisza.cpp index fa31e7ba0c..07479fac31 100644 --- a/src/IISLib/multisza.cpp +++ b/src/IISLib/multisza.cpp @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. +#pragma warning (disable : 4267) #include "precomp.h" #include "multisza.h" #include @@ -404,3 +405,4 @@ Finished: return hr; } +#pragma warning(default:4267) \ No newline at end of file diff --git a/src/IISLib/stringu.cpp b/src/IISLib/stringu.cpp index 419d94dbca..4d92a4d023 100644 --- a/src/IISLib/stringu.cpp +++ b/src/IISLib/stringu.cpp @@ -1,6 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. +#pragma warning (disable : 4267) + #include "precomp.h" STRU::STRU( @@ -1265,3 +1267,5 @@ Exit: return hr; } + +#pragma warning(default:4267)