[IPHLPAPI] Fix getNumRoutes() return value, on Mib error (#391)
authorSerge Gautherie <32623169+SergeGautherie@users.noreply.github.com>
Fri, 23 Feb 2018 17:35:02 +0000 (18:35 +0100)
committerGed Murphy <gedmurphy@reactos.org>
Fri, 23 Feb 2018 17:35:02 +0000 (17:35 +0000)
dll/win32/iphlpapi/ipstats_reactos.c

index 2b981c1..ed95d42 100644 (file)
@@ -387,9 +387,9 @@ DWORD getNumRoutes(void)
             memset( &isnmp, 0, sizeof( isnmp ) );
             status = tdiGetMibForIpEntity( tcpFile, &entitySet[i], &isnmp );
             if( !NT_SUCCESS(status) ) {
-                tdiFreeThingSet( entitySet );
-                closeTcpFile( tcpFile );
-                return status;
+                WARN("tdiGetMibForIpEntity failed for i = %d", i);
+                numRoutes = 0;
+                break;
             }
             numRoutes += isnmp.ipsi_numroutes;
         }