Fix refsvfs2 bug that counted uninitialized leak checking as enabled.

PiperOrigin-RevId: 465118656
This commit is contained in:
Lucas Manning
2022-08-03 12:24:45 -07:00
committed by gVisor bot
parent 974792ae18
commit 1c220bf2a4
+2 -1
View File
@@ -50,7 +50,8 @@ func init() {
// LeakCheckEnabled returns whether leak checking is enabled. The following
// functions should only be called if it returns true.
func LeakCheckEnabled() bool {
return refs_vfs1.GetLeakMode() != refs_vfs1.NoLeakChecking
mode := refs_vfs1.GetLeakMode()
return mode != refs_vfs1.NoLeakChecking && mode != refs_vfs1.UninitializedLeakChecking
}
// leakCheckPanicEnabled returns whether DoLeakCheck() should panic when leaks