- Don't allocate pool if there is nothing in the route table
- Fixes bug 5493

svn path=/trunk/; revision=48637
This commit is contained in:
Cameron Gutman
2010-08-29 02:29:10 +00:00
parent a3370efc0a
commit c8ff03d682
+13 -7
View File
@@ -21,15 +21,21 @@ TDI_STATUS InfoTdiQueryGetRouteTable( PIP_INTERFACE IF, PNDIS_BUFFER Buffer, PUI
KIRQL OldIrql;
UINT RtCount = CountFIBs(IF);
UINT Size = sizeof( IPROUTE_ENTRY ) * RtCount;
PFIB_ENTRY RCache =
ExAllocatePool( NonPagedPool, sizeof( FIB_ENTRY ) * RtCount ),
RCacheCur = RCache;
PIPROUTE_ENTRY RouteEntries = ExAllocatePool( NonPagedPool, Size ),
RtCurrent = RouteEntries;
PFIB_ENTRY RCache, RCacheCur;
PIPROUTE_ENTRY RouteEntries, RtCurrent;
UINT i;
TI_DbgPrint(DEBUG_INFO, ("Called, routes = %d, RCache = %08x\n",
RtCount, RCache));
TI_DbgPrint(DEBUG_INFO, ("Called, routes = %d\n",
RtCount));
if (RtCount == 0)
return InfoCopyOut(NULL, 0, NULL, BufferSize);
RouteEntries = ExAllocatePool( NonPagedPool, Size );
RtCurrent = RouteEntries;
RCache = ExAllocatePool( NonPagedPool, sizeof( FIB_ENTRY ) * RtCount );
RCacheCur = RCache;
if( !RCache || !RouteEntries ) {
if( RCache ) ExFreePool( RCache );