[OLE #137] Don't release a null pointer

Huw D M Davies h.davies1 at physics.ox.ac.uk
Wed Nov 2 14:28:33 CST 2005


        Huw Davies <huw at codeweavers.com>
        Don't call Release on a null ptr.
Index: dlls/oleaut32/typelib.c
===================================================================
RCS file: /home/wine/wine/dlls/oleaut32/typelib.c,v
retrieving revision 1.173
diff -u -p -r1.173 typelib.c
--- dlls/oleaut32/typelib.c	2 Nov 2005 19:59:13 -0000	1.173
+++ dlls/oleaut32/typelib.c	2 Nov 2005 20:26:56 -0000
@@ -5064,7 +5064,10 @@ static HRESULT WINAPI ITypeInfo_fnInvoke
                          * variants here too */
                         if ((V_VT(&varresult) == (VT_UNKNOWN | VT_BYREF)) ||
                             (V_VT(&varresult) == (VT_DISPATCH | VT_BYREF)))
-                            IUnknown_Release(*V_UNKNOWNREF(&varresult));
+                        {
+                            if(*V_UNKNOWNREF(&varresult))
+                                IUnknown_Release(*V_UNKNOWNREF(&varresult));
+                        }
                         break;
 		    }
 		}



More information about the wine-patches mailing list