Author: cgutman
Date: Sun Oct 26 15:57:26 2008
New Revision: 37000
URL:
http://svn.reactos.org/svn/reactos?rev=37000&view=rev
Log:
- Check the status of AddGenericHeaderIPv4
- Fix a leak
Modified:
branches/aicom-network-fixes/lib/drivers/ip/transport/udp/udp.c
Modified: branches/aicom-network-fixes/lib/drivers/ip/transport/udp/udp.c
URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/lib/drivers…
==============================================================================
--- branches/aicom-network-fixes/lib/drivers/ip/transport/udp/udp.c [iso-8859-1]
(original)
+++ branches/aicom-network-fixes/lib/drivers/ip/transport/udp/udp.c [iso-8859-1] Sun Oct
26 15:57:26 2008
@@ -33,15 +33,19 @@
*/
{
PUDP_HEADER UDPHeader;
+ NTSTATUS Status;
TI_DbgPrint(MID_TRACE, ("Packet: %x NdisPacket %x\n",
IPPacket, IPPacket->NdisPacket));
- AddGenericHeaderIPv4
+ Status = AddGenericHeaderIPv4
( RemoteAddress, RemotePort,
LocalAddress, LocalPort,
IPPacket, DataLength, IPPROTO_UDP,
sizeof(UDP_HEADER), (PVOID *)&UDPHeader );
+
+ if (!NT_SUCCESS(Status))
+ return Status;
/* Build UDP header */
UDPHeader = (PUDP_HEADER)((ULONG_PTR)IPPacket->Data - sizeof(UDP_HEADER));
@@ -195,8 +199,10 @@
if( !NT_SUCCESS(Status) )
return Status;
- if(!(NCE = RouteGetRouteToDestination( &RemoteAddress )))
+ if(!(NCE = RouteGetRouteToDestination( &RemoteAddress ))) {
+ FreeNdisPacket(Packet.NdisPacket);
return STATUS_UNSUCCESSFUL;
+ }
IPSendDatagram( &Packet, NCE, UDPSendPacketComplete, NULL );