Author: jmorlan
Date: Thu Jul 31 16:33:17 2008
New Revision: 34984
URL:
http://svn.reactos.org/svn/reactos?rev=34984&view=rev
Log:
Fix handle leaks in RtlCreateUserThread and SmExecPgm.
Modified:
trunk/reactos/base/system/smss/smapiexec.c
trunk/reactos/lib/rtl/thread.c
Modified: trunk/reactos/base/system/smss/smapiexec.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/smss/smapiexec…
==============================================================================
--- trunk/reactos/base/system/smss/smapiexec.c [iso-8859-1] (original)
+++ trunk/reactos/base/system/smss/smapiexec.c [iso-8859-1] Thu Jul 31 16:33:17 2008
@@ -265,6 +265,8 @@
DPRINT1("SM: %s: SmCreateClient failed (Status=0x%08lx)\n",
__FUNCTION__, Status);
}
+ NtClose(ProcessInfo.ThreadHandle);
+ NtClose(ProcessInfo.ProcessHandle);
}
}
else
Modified: trunk/reactos/lib/rtl/thread.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/thread.c?rev=34984…
==============================================================================
--- trunk/reactos/lib/rtl/thread.c [iso-8859-1] (original)
+++ trunk/reactos/lib/rtl/thread.c [iso-8859-1] Thu Jul 31 16:33:17 2008
@@ -209,7 +209,10 @@
else
{
/* Return thread data */
- if (ThreadHandle) *ThreadHandle = Handle;
+ if (ThreadHandle)
+ *ThreadHandle = Handle;
+ else
+ NtClose(Handle);
if (ClientId) *ClientId = ThreadCid;
}