mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-29 19:26:33 +00:00
fix heap corruption when lpStringToFind is NULL
Fix for Coverity error CID: 775. svn path=/trunk/; revision=36410
This commit is contained in:
@@ -30,7 +30,7 @@ FindActCtxSectionStringA(
|
||||
)
|
||||
{
|
||||
BOOL bRetVal;
|
||||
LPWSTR lpStringToFindW;
|
||||
LPWSTR lpStringToFindW = NULL;
|
||||
|
||||
/* Convert lpStringToFind */
|
||||
if (lpStringToFind)
|
||||
@@ -47,7 +47,8 @@ FindActCtxSectionStringA(
|
||||
ReturnedData);
|
||||
|
||||
/* Clean up */
|
||||
RtlFreeHeap(GetProcessHeap(), 0, (LPWSTR*) lpStringToFindW);
|
||||
if (lpStringToFindW)
|
||||
RtlFreeHeap(GetProcessHeap(), 0, (LPWSTR*) lpStringToFindW);
|
||||
|
||||
return bRetVal;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user