[PATCH] xaudio2_7: Correct reference count on newly created IXAPO object

Alistair Leslie-Hughes leslie_alistair at hotmail.com
Mon Mar 9 05:10:30 CDT 2020


Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
---
 dlls/xaudio2_7/xapo.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/dlls/xaudio2_7/xapo.c b/dlls/xaudio2_7/xapo.c
index 9788cb38e8..e64523ea19 100644
--- a/dlls/xaudio2_7/xapo.c
+++ b/dlls/xaudio2_7/xapo.c
@@ -367,12 +367,9 @@ static HRESULT WINAPI xapocf_CreateInstance(IClassFactory *iface, IUnknown *pOut
     }
 
     hr = IXAPO_QueryInterface(&object->IXAPO_iface, riid, ppobj);
-    if(FAILED(hr)){
-        HeapFree(GetProcessHeap(), 0, object);
-        return hr;
-    }
+    IXAPO_Release(&object->IXAPO_iface);
 
-    return S_OK;
+    return hr;
 }
 
 static HRESULT WINAPI xapocf_LockServer(IClassFactory *iface, BOOL dolock)
-- 
2.25.1




More information about the wine-devel mailing list