mirror of
https://github.com/reactos/reactos.git
synced 2024-09-18 16:52:54 +00:00
- Fix cleanup code
- We could possibly end up there with a NULL FileHandleObject and return a garbage FileHandle or crash - Now we always return a NULL FileHandle when we fail and free FileHandleObject if it has been allocated svn path=/branches/aicom-network-fixes/; revision=35946
This commit is contained in:
parent
4ff5fc5caa
commit
16427a1482
|
@ -331,10 +331,12 @@ cleanup:
|
||||||
ExFreePool ( FullFileName.Buffer );
|
ExFreePool ( FullFileName.Buffer );
|
||||||
FullFileName.Buffer = NULL;
|
FullFileName.Buffer = NULL;
|
||||||
}
|
}
|
||||||
if ( !NT_SUCCESS(*Status) && FileHandleObject != NULL )
|
if ( !NT_SUCCESS(*Status) )
|
||||||
{
|
{
|
||||||
|
if( FileHandleObject ) {
|
||||||
ExFreePool ( FileHandleObject );
|
ExFreePool ( FileHandleObject );
|
||||||
FileHandleObject = NULL;
|
FileHandleObject = NULL;
|
||||||
|
}
|
||||||
*FileHandle = NULL;
|
*FileHandle = NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue