diff --git a/reactos/drivers/fs/vfat/create.c b/reactos/drivers/fs/vfat/create.c index 800a66aecbd..41ef6f26f93 100644 --- a/reactos/drivers/fs/vfat/create.c +++ b/reactos/drivers/fs/vfat/create.c @@ -564,7 +564,12 @@ VfatCreateFile (PDEVICE_OBJECT DeviceObject, PIRP Irp) vfatReleaseFCB (DeviceExt, ParentFcb); if (NT_SUCCESS (Status)) { - vfatAttachFCBToFileObject (DeviceExt, pFcb, FileObject); + Status = vfatAttachFCBToFileObject (DeviceExt, pFcb, FileObject); + if ( !NT_SUCCESS(Status) ) + { + vfatReleaseFCB (DeviceExt, pFcb); + return Status; + } Irp->IoStatus.Information = FILE_CREATED;