Author: cgutman
Date: Thu Sep 4 14:08:08 2008
New Revision: 35946
URL:
http://svn.reactos.org/svn/reactos?rev=35946&view=rev
Log:
- 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
Modified:
branches/aicom-network-fixes/drivers/network/ndis/ndis/stubs.c
Modified: branches/aicom-network-fixes/drivers/network/ndis/ndis/stubs.c
URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/net…
==============================================================================
--- branches/aicom-network-fixes/drivers/network/ndis/ndis/stubs.c [iso-8859-1]
(original)
+++ branches/aicom-network-fixes/drivers/network/ndis/ndis/stubs.c [iso-8859-1] Thu Sep 4
14:08:08 2008
@@ -331,10 +331,12 @@
ExFreePool ( FullFileName.Buffer );
FullFileName.Buffer = NULL;
}
- if ( !NT_SUCCESS(*Status) && FileHandleObject != NULL )
+ if ( !NT_SUCCESS(*Status) )
{
- ExFreePool ( FileHandleObject );
- FileHandleObject = NULL;
+ if( FileHandleObject ) {
+ ExFreePool ( FileHandleObject );
+ FileHandleObject = NULL;
+ }
*FileHandle = NULL;
}
else