Nikolay Sivov : shell32: Return as soon as requested CLSID is located ( Coverity).

Alexandre Julliard julliard at wine.codeweavers.com
Wed Nov 11 08:36:45 CST 2015


Module: wine
Branch: master
Commit: 5cf95396503d49f0249c473c1ed51e51213124c0
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=5cf95396503d49f0249c473c1ed51e51213124c0

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Wed Nov 11 14:01:37 2015 +0300

shell32: Return as soon as requested CLSID is located (Coverity).

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/shell32/shellole.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/dlls/shell32/shellole.c b/dlls/shell32/shellole.c
index 637a101..f034951 100644
--- a/dlls/shell32/shellole.c
+++ b/dlls/shell32/shellole.c
@@ -59,7 +59,7 @@ static IClassFactory * IDefClF_fnConstructor(LPFNCREATEINSTANCE lpfnCI, PLONG pc
 
 /* this table contains all CLSIDs of shell32 objects */
 static const struct {
-	REFIID			riid;
+	REFIID			clsid;
 	LPFNCREATEINSTANCE	lpfnCI;
 } InterfaceTable[] = {
 
@@ -204,8 +204,8 @@ end:
  */
 HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv)
 {
-	HRESULT	hres = E_OUTOFMEMORY;
 	IClassFactory * pcf = NULL;
+	HRESULT	hres;
 	int i;
 
 	TRACE("CLSID:%s,IID:%s\n",shdebugstr_guid(rclsid),shdebugstr_guid(iid));
@@ -214,10 +214,11 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv)
 	*ppv = NULL;
 
 	/* search our internal interface table */
-	for(i=0;InterfaceTable[i].riid;i++) {
-	    if(IsEqualIID(InterfaceTable[i].riid, rclsid)) {
+	for(i=0;InterfaceTable[i].clsid;i++) {
+	    if(IsEqualIID(InterfaceTable[i].clsid, rclsid)) {
 	        TRACE("index[%u]\n", i);
 	        pcf = IDefClF_fnConstructor(InterfaceTable[i].lpfnCI, NULL, NULL);
+	        break;
 	    }
 	}
 




More information about the wine-cvs mailing list