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>
if( pNonPagedDirEntry == NULL)
{
- AFSExFreePool( pDirNode);
-
- AFSDeleteObjectInfo( pObjectInfoCB);
-
try_return( ntStatus = STATUS_INSUFFICIENT_RESOURCES);
}
try_exit:
- NOTHING;
+ if ( !NT_SUCCESS( ntStatus))
+ {
+
+ if ( pDirNode != NULL)
+ {
+
+ AFSExFreePool( pDirNode);
+ }
+
+ if ( pObjectInfoCB != NULL)
+ {
+
+ AFSDeleteObjectInfo( pObjectInfoCB);
+ }
+ }
}
return ntStatus;