mirror of
https://github.com/reactos/reactos.git
synced 2024-07-06 20:55:16 +00:00
- Minor correction to NtConnectPort to avoid freeing NULL pointer. Based on patch by Waldo Alvarez Ca�izares.
svn path=/trunk/; revision=8282
This commit is contained in:
parent
6659cc3181
commit
30e8e2d0b0
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: connect.c,v 1.25 2004/02/02 23:48:42 ea Exp $
|
/* $Id: connect.c,v 1.26 2004/02/21 09:06:27 navaraf Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -432,20 +432,20 @@ NtConnectPort (PHANDLE UnsafeConnectedPortHandle,
|
||||||
{
|
{
|
||||||
if (UnsafeConnectDataLength != NULL)
|
if (UnsafeConnectDataLength != NULL)
|
||||||
{
|
{
|
||||||
if (ExGetPreviousMode() != KernelMode)
|
Status = MmCopyToCaller(UnsafeConnectDataLength,
|
||||||
{
|
&ConnectDataLength,
|
||||||
Status = MmCopyToCaller(UnsafeConnectData,
|
sizeof(ULONG));
|
||||||
ConnectData,
|
|
||||||
ConnectDataLength);
|
|
||||||
ExFreePool(ConnectData);
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
return(Status);
|
return(Status);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Status = MmCopyToCaller(UnsafeConnectDataLength,
|
if (UnsafeConnectData != NULL && ConnectData != NULL)
|
||||||
&ConnectDataLength,
|
{
|
||||||
sizeof(ULONG));
|
Status = MmCopyToCaller(UnsafeConnectData,
|
||||||
|
ConnectData,
|
||||||
|
ConnectDataLength);
|
||||||
|
ExFreePool(ConnectData);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
return(Status);
|
return(Status);
|
||||||
|
|
Loading…
Reference in a new issue