fix heap corruption when lpStringToFind is NULL

Fix for Coverity error CID: 775.

svn path=/trunk/; revision=36410
This commit is contained in:
Christoph von Wittich
2008-09-23 06:55:05 +00:00
parent 9b1a7c47bd
commit 2aabf8b66d
+3 -2
View File
@@ -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;
}