Fix handle leaks in RtlCreateUserThread and SmExecPgm.

svn path=/trunk/; revision=34984
This commit is contained in:
Jeffrey Morlan 2008-07-31 21:33:17 +00:00
parent ffad542df1
commit 717a13e2d7
2 changed files with 6 additions and 1 deletions

View file

@ -265,6 +265,8 @@ SMAPI(SmExecPgm)
DPRINT1("SM: %s: SmCreateClient failed (Status=0x%08lx)\n", DPRINT1("SM: %s: SmCreateClient failed (Status=0x%08lx)\n",
__FUNCTION__, Status); __FUNCTION__, Status);
} }
NtClose(ProcessInfo.ThreadHandle);
NtClose(ProcessInfo.ProcessHandle);
} }
} }
else else

View file

@ -209,7 +209,10 @@ RtlCreateUserThread(IN HANDLE ProcessHandle,
else else
{ {
/* Return thread data */ /* Return thread data */
if (ThreadHandle) *ThreadHandle = Handle; if (ThreadHandle)
*ThreadHandle = Handle;
else
NtClose(Handle);
if (ClientId) *ClientId = ThreadCid; if (ClientId) *ClientId = ThreadCid;
} }