Author: cwittich
Date: Sun Jan 20 20:01:42 2008
New Revision: 31907
URL:
http://svn.reactos.org/svn/reactos?rev=31907&view=rev
Log:
fix process token leaks
Modified:
trunk/reactos/dll/win32/msi/registry.c
Modified: trunk/reactos/dll/win32/msi/registry.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msi/registry.c?r…
==============================================================================
--- trunk/reactos/dll/win32/msi/registry.c (original)
+++ trunk/reactos/dll/win32/msi/registry.c Sun Jan 20 20:01:42 2008
@@ -479,11 +479,19 @@
size = sizeof(buf);
if (!GetTokenInformation(token, TokenUser, (void *)buf, size, &size))
- return ERROR_FUNCTION_FAILED;
+ {
+ CloseHandle(token);
+ return ERROR_FUNCTION_FAILED;
+ }
user = (PTOKEN_USER)buf;
if (!ConvertSidToStringSidW(user->User.Sid, usersid))
- return ERROR_FUNCTION_FAILED;
+ {
+ CloseHandle(token);
+ return ERROR_FUNCTION_FAILED;
+ }
+
+ CloseHandle(token);
return ERROR_SUCCESS;
}