Windows: AFSInitPIOCtlDirectoryCB free in try_exit

Process all conditional release of allocated memory on
failure within the try_exit on failure.

Change-Id: I4a29f6e9d2506c00713558849c49c377a74d607a
Reviewed-on: http://gerrit.openafs.org/5625
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
This commit is contained in:
Jeffrey Altman 2011-10-17 09:26:13 -04:00 committed by Jeffrey Altman
parent 782fba58db
commit ada5908ca1

View File

@ -5448,10 +5448,6 @@ AFSInitPIOCtlDirectoryCB( IN AFSObjectInfoCB *ObjectInfo)
if( pNonPagedDirEntry == NULL)
{
AFSExFreePool( pDirNode);
AFSDeleteObjectInfo( pObjectInfoCB);
try_return( ntStatus = STATUS_INSUFFICIENT_RESOURCES);
}
@ -5492,7 +5488,21 @@ AFSInitPIOCtlDirectoryCB( IN AFSObjectInfoCB *ObjectInfo)
try_exit:
NOTHING;
if ( !NT_SUCCESS( ntStatus))
{
if ( pDirNode != NULL)
{
AFSExFreePool( pDirNode);
}
if ( pObjectInfoCB != NULL)
{
AFSDeleteObjectInfo( pObjectInfoCB);
}
}
}
return ntStatus;