Author: cwittich Date: Tue Sep 23 01:55:05 2008 New Revision: 36410
URL: http://svn.reactos.org/svn/reactos?rev=36410&view=rev Log: fix heap corruption when lpStringToFind is NULL Fix for Coverity error CID: 775.
Modified: trunk/reactos/dll/win32/kernel32/misc/actctx.c
Modified: trunk/reactos/dll/win32/kernel32/misc/actctx.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/act... ============================================================================== --- trunk/reactos/dll/win32/kernel32/misc/actctx.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/misc/actctx.c [iso-8859-1] Tue Sep 23 01:55:05 2008 @@ -30,7 +30,7 @@ ) { BOOL bRetVal; - LPWSTR lpStringToFindW; + LPWSTR lpStringToFindW = NULL;
/* Convert lpStringToFind */ if (lpStringToFind) @@ -47,7 +47,8 @@ ReturnedData);
/* Clean up */ - RtlFreeHeap(GetProcessHeap(), 0, (LPWSTR*) lpStringToFindW); + if (lpStringToFindW) + RtlFreeHeap(GetProcessHeap(), 0, (LPWSTR*) lpStringToFindW);
return bRetVal; }