mirror of
https://github.com/reactos/reactos.git
synced 2024-10-02 07:26:47 +00:00
[DEVMGR] - Actually fail on error in AllocAndLoadStringsCat (CID 716793/716794)
[IPHLPAPI] - Fix a use after free in getNthInterfaceEntity (CID 716795 - partly reverts r53190). Fix a possible double free in getArpTable (CID 716796). svn path=/trunk/; revision=57127
This commit is contained in:
parent
a4a967f486
commit
b2fa124766
|
@ -130,6 +130,7 @@ AllocAndLoadStringsCat(OUT LPWSTR *lpTarget,
|
|||
if (!(Ret = LoadStringW(hInst, uID[i], s, ln)))
|
||||
{
|
||||
LocalFree((HLOCAL)(*lpTarget));
|
||||
return 0;
|
||||
}
|
||||
|
||||
s += Ret;
|
||||
|
|
|
@ -287,12 +287,12 @@ DWORD getNthInterfaceEntity( HANDLE tcpFile, DWORD index, TDIEntityID *ent ) {
|
|||
TRACE("Index %d is entity #%d - %04x:%08x\n", index, i,
|
||||
entitySet[i].tei_entity, entitySet[i].tei_instance );
|
||||
|
||||
tdiFreeThingSet( entitySet );
|
||||
|
||||
if( numInterfaces == index && i < numEntities ) {
|
||||
memcpy( ent, &entitySet[i], sizeof(*ent) );
|
||||
tdiFreeThingSet( entitySet );
|
||||
return STATUS_SUCCESS;
|
||||
} else {
|
||||
tdiFreeThingSet( entitySet );
|
||||
return STATUS_UNSUCCESSFUL;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -582,13 +582,12 @@ PMIB_IPNETTABLE getArpTable(void)
|
|||
(PVOID *)&AdapterArpTable,
|
||||
&returnSize );
|
||||
|
||||
if( status == STATUS_SUCCESS ) {
|
||||
for( TmpIdx = 0; TmpIdx < returnSize; TmpIdx++, CurrIdx++ )
|
||||
IpArpTable->table[CurrIdx] = AdapterArpTable[TmpIdx];
|
||||
}
|
||||
|
||||
if( AdapterArpTable ) tdiFreeThingSet( AdapterArpTable );
|
||||
}
|
||||
if( status == STATUS_SUCCESS ) {
|
||||
for( TmpIdx = 0; TmpIdx < returnSize; TmpIdx++, CurrIdx++ )
|
||||
IpArpTable->table[CurrIdx] = AdapterArpTable[TmpIdx];
|
||||
tdiFreeThingSet( AdapterArpTable );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
closeTcpFile( tcpFile );
|
||||
|
|
Loading…
Reference in a new issue