mirror of
				https://github.com/winfsp/winfsp.git
				synced 2025-11-03 20:48:08 -06:00 
			
		
		
		
	sys: FspVolumeMountNoLock: dereference FsvrtDeviceObject on success
resolves a VPB/FsvrtDeviceObject leak
This commit is contained in:
		@@ -473,6 +473,13 @@ static NTSTATUS FspVolumeMountNoLock(
 | 
				
			|||||||
    Vpb->SerialNumber = FsvolDeviceExtension->VolumeParams.VolumeSerialNumber;
 | 
					    Vpb->SerialNumber = FsvolDeviceExtension->VolumeParams.VolumeSerialNumber;
 | 
				
			||||||
    IoReleaseVpbSpinLock(Irql);
 | 
					    IoReleaseVpbSpinLock(Irql);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /*
 | 
				
			||||||
 | 
					     * Argh! Turns out that the IrpSp->Parameters.MountVolume.DeviceObject is
 | 
				
			||||||
 | 
					     * passed to us with an extra reference, which is not removed on SUCCESS.
 | 
				
			||||||
 | 
					     * So go ahead and dereference it now!
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    ObDereferenceObject(FsvrtDeviceObject);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Irp->IoStatus.Information = 0;
 | 
					    Irp->IoStatus.Information = 0;
 | 
				
			||||||
    return STATUS_SUCCESS;
 | 
					    return STATUS_SUCCESS;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user