[PATCH] dmloader: check return of CoCreateInstance (Coverity)

Marcus Meissner meissner at suse.de
Mon Jan 7 15:17:25 CST 2013


CID 966604

Ciao, Marcus
---
 dlls/dmloader/loader.c |    6 +++++-
 1 Datei geändert, 5 Zeilen hinzugefügt(+), 1 Zeile entfernt(-)

diff --git a/dlls/dmloader/loader.c b/dlls/dmloader/loader.c
index 9a4bddc..39f00a0 100644
--- a/dlls/dmloader/loader.c
+++ b/dlls/dmloader/loader.c
@@ -463,7 +463,11 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_SetObject(IDirectMusicLoader8 *ifac
 	}
 
 	/* create object */
-	CoCreateInstance (&pDesc->guidClass, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusicObject, (LPVOID*)&pObject);
+	hr = CoCreateInstance (&pDesc->guidClass, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusicObject, (LPVOID*)&pObject);
+        if (FAILED(hr)) {
+		ERR("Object creation of %s failed 0x%08x\n", debugstr_guid(&pDesc->guidClass),hr);
+		return DMUS_E_LOADER_FAILEDOPEN;
+        }
 
 	/* *sigh*... some ms objects have lousy implementation of ParseDescriptor that clears input descriptor :( */
 #ifdef NOW_WE_ARE_FREE
-- 
1.7.10.4




More information about the wine-patches mailing list