Author: tfaber
Date: Mon Sep 19 08:15:24 2016
New Revision: 72738
URL:
http://svn.reactos.org/svn/reactos?rev=72738&view=rev
Log:
[AFD]
- Fix MDL leak in failure case of AfdGetSockName. Patch by Volodymyr Shcherbyna. CID
1322161.
CORE-11096 #resolve
Modified:
trunk/reactos/drivers/network/afd/afd/info.c
Modified: trunk/reactos/drivers/network/afd/afd/info.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/in…
==============================================================================
--- trunk/reactos/drivers/network/afd/afd/info.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/afd/afd/info.c [iso-8859-1] Mon Sep 19 08:15:24 2016
@@ -198,6 +198,7 @@
PMDL Mdl = NULL;
UNREFERENCED_PARAMETER(DeviceObject);
+ ASSERT(Irp->MdlAddress == NULL);
if( !SocketAcquireStateLock( FCB ) ) return LostSocket( Irp );
@@ -226,6 +227,11 @@
TDI_QUERY_ADDRESS_INFO,
Mdl );
}
+
+ /* Check if MmProbeAndLockPages or TdiQueryInformation failed and
+ * clean up Mdl */
+ if (!NT_SUCCESS(Status) && Irp->MdlAddress != Mdl)
+ IoFreeMdl(Mdl);
} else
Status = STATUS_INSUFFICIENT_RESOURCES;