From 75b0ed4aaf30bb3eef57cf09f8951980c63cbdd1 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Sat, 20 Jun 2026 21:05:06 -0400 Subject: [PATCH] ext/com_dotnet: release the held IUnknown in com_get_active_object() The cleanup block guarded on `unk` but released `obj`, so a successful GetActiveObject() released the IDispatch proxy twice (once already under the obj guard) and never released the IUnknown it returned, leaking it. Release `unk` so each interface pointer is released exactly once. --- ext/com_dotnet/com_com.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/com_dotnet/com_com.c b/ext/com_dotnet/com_com.c index fd2d1ee9a439..cfc343405e0e 100644 --- a/ext/com_dotnet/com_com.c +++ b/ext/com_dotnet/com_com.c @@ -321,7 +321,7 @@ PHP_FUNCTION(com_get_active_object) IDispatch_Release(obj); } if (unk) { - IUnknown_Release(obj); + IUnknown_Release(unk); } efree(module); }