From 2aabf8b66d78c0eaaa9011b79b72ebbd03fa6554 Mon Sep 17 00:00:00 2001 From: Christoph von Wittich Date: Tue, 23 Sep 2008 06:55:05 +0000 Subject: [PATCH] fix heap corruption when lpStringToFind is NULL Fix for Coverity error CID: 775. svn path=/trunk/; revision=36410 --- reactos/dll/win32/kernel32/misc/actctx.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/reactos/dll/win32/kernel32/misc/actctx.c b/reactos/dll/win32/kernel32/misc/actctx.c index d70fa3172d5..13c04e977f4 100644 --- a/reactos/dll/win32/kernel32/misc/actctx.c +++ b/reactos/dll/win32/kernel32/misc/actctx.c @@ -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; }