Author: pschweitzer Date: Sun Oct 26 15:35:18 2014 New Revision: 65013
URL: http://svn.reactos.org/svn/reactos?rev=65013&view=rev Log: [FASTFAT] Don't leak reference on failure in vfatPrepareTargetForRename().
Modified: trunk/reactos/drivers/filesystems/fastfat/finfo.c
Modified: trunk/reactos/drivers/filesystems/fastfat/finfo.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfat... ============================================================================== --- trunk/reactos/drivers/filesystems/fastfat/finfo.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat/finfo.c [iso-8859-1] Sun Oct 26 15:35:18 2014 @@ -400,6 +400,7 @@ /* If that's a directory or a read-only file, we're not allowed */ if (vfatFCBIsDirectory(TargetFcb) || ((*TargetFcb->Attributes & FILE_ATTRIBUTE_READONLY) == FILE_ATTRIBUTE_READONLY)); { + vfatReleaseFCB(DeviceExt, *ParentFCB); *ParentFCB = NULL; vfatReleaseFCB(DeviceExt, TargetFcb); return STATUS_OBJECT_NAME_COLLISION; @@ -408,6 +409,7 @@ /* Attempt to flush (might close the file) */ if (!MmFlushImageSection(TargetFcb->FileObject->SectionObjectPointer, MmFlushForDelete)) { + vfatReleaseFCB(DeviceExt, *ParentFCB); *ParentFCB = NULL; vfatReleaseFCB(DeviceExt, TargetFcb); return STATUS_ACCESS_DENIED; @@ -416,6 +418,7 @@ /* If we are, ensure the file isn't open by anyone! */ if (TargetFcb->OpenHandleCount != 0) { + vfatReleaseFCB(DeviceExt, *ParentFCB); *ParentFCB = NULL; vfatReleaseFCB(DeviceExt, TargetFcb); return STATUS_ACCESS_DENIED; @@ -429,6 +432,7 @@ } else { + vfatReleaseFCB(DeviceExt, *ParentFCB); *ParentFCB = NULL; vfatReleaseFCB(DeviceExt, TargetFcb); return STATUS_OBJECT_NAME_COLLISION;