mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 18:52:57 +00:00
[REGEXPL]
Fix memory leaks Fix broken if condition Use delete[] operator for allocations made with new[] operator Properly check for failed allocations by not throwing exception svn path=/trunk/; revision=54034
This commit is contained in:
parent
7e02fbd0dd
commit
c91f9ef382
16 changed files with 100 additions and 82 deletions
|
@ -47,7 +47,7 @@ HRESULT CSettings::Clean()
|
|||
{
|
||||
if (m_pszPrompt)
|
||||
{
|
||||
delete m_pszPrompt;
|
||||
delete[] m_pszPrompt;
|
||||
m_pszPrompt = NULL;
|
||||
}
|
||||
|
||||
|
@ -75,7 +75,7 @@ HRESULT CSettings::Load(LPCTSTR pszLoadKey)
|
|||
nError = RegQueryValueEx(hKey,PROMPT_VALUE_NAME,NULL,&dwType,NULL,&dwSize);
|
||||
if (nError == ERROR_SUCCESS && dwType == REG_SZ)
|
||||
{
|
||||
m_pszPrompt = (TCHAR *) new BYTE[dwSize];
|
||||
m_pszPrompt = (TCHAR *) new (std::nothrow) BYTE[dwSize];
|
||||
if (!m_pszPrompt)
|
||||
{
|
||||
hr = E_OUTOFMEMORY;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue