From 9e5fe9daaec0a6f7fcf65c1a46b3b41cdb2c55af Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Thu, 31 Jul 2008 13:44:31 +0000 Subject: [PATCH] DEVEL15-windows-wix-custom-20080731 LICENSE MIT in c++, arrays allocated with new[] must be deallocated with delete[] (cherry picked from commit 14e516f1d5304a1b00c40321124a6b2067b977f2) --- src/WINNT/install/wix/custom/afscustom.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/WINNT/install/wix/custom/afscustom.cpp b/src/WINNT/install/wix/custom/afscustom.cpp index edf195598..08f15544e 100644 --- a/src/WINNT/install/wix/custom/afscustom.cpp +++ b/src/WINNT/install/wix/custom/afscustom.cpp @@ -1,6 +1,7 @@ /* Copyright 2004 by the Massachusetts Institute of Technology +Copyright 2008 by Secure Endpoints Inc. All rights reserved. @@ -96,9 +97,9 @@ MSIDLLEXPORT AbortMsiImmediate( MSIHANDLE hInstall ) { MsiProcessMessage(hInstall, INSTALLMESSAGE_ERROR, hRecord); _cleanup: - if(sFormatted) delete sFormatted; + if(sFormatted) delete[] sFormatted; if(hRecord) MsiCloseHandle( hRecord ); - if(sReason) delete sReason; + if(sReason) delete[] sReason; return ~ERROR_SUCCESS; } @@ -205,7 +206,7 @@ _cleanup: ShowMsiError( hInstall, ERR_NPI_FAILED, rv ); } - if(strOrder) delete strOrder; + if(strOrder) delete[] strOrder; return rv; } @@ -259,8 +260,8 @@ int npi_CheckAndAddRemove( LPTSTR str, LPTSTR str2, int bInst ) { cleanup: - delete target; - delete charset; + delete[] target; + delete[] charset; return ret; } @@ -369,7 +370,7 @@ _cleanup: if(pInfo.hProcess) CloseHandle( pInfo.hProcess ); if(pInfo.hThread) CloseHandle( pInfo.hThread ); if(hJob) CloseHandle(hJob); - if(strPathUninst) delete strPathUninst; + if(strPathUninst) delete[] strPathUninst; if(rv != ERROR_SUCCESS) { ShowMsiError( hInstall, ERR_NSS_FAILED, rv ); -- 2.39.5