Fix handle leak when creating or opening named mutex fails
authorKoundinya Veluri <kouvel@microsoft.com>
Mon, 23 May 2016 17:42:08 +0000 (10:42 -0700)
committerKoundinya Veluri <kouvel@microsoft.com>
Wed, 1 Jun 2016 10:47:39 +0000 (03:47 -0700)
commitcb84cf93f0c2b29030ee19f18ede40829b26c009
treed939aae55f4100c14f1a44f0065d9903e2cbca40
parent4858503fa9baa15f05dffac79f488d478313ec48
Fix handle leak when creating or opening named mutex fails

- After the pal object is registered, it gets a second reference from the handle. Upon an error after that, the handle needs to be revoked in addition to releasing the initial reference.

Commit migrated from https://github.com/dotnet/coreclr/commit/bf6e190fe6ef7289d94545304b5c409f379658b9
src/coreclr/src/pal/src/synchobj/mutex.cpp