[PATCH] ole32: check for interface NULL which happens with e.g. Abiword

Marcus Meissner marcus at jet.franken.de
Wed Sep 15 05:59:27 CDT 2010


Hi,

spotted by reporters in #winehackers, via
http://www.abisource.com/downloads/abiword/2.6.8/Windows/abiword-setup-2.6.8.exe

hr is S_OK, but unk is also NULL.

Ciao, Marcus
---
 dlls/ole32/ole2.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/dlls/ole32/ole2.c b/dlls/ole32/ole2.c
index a9a4885..79aca73 100644
--- a/dlls/ole32/ole2.c
+++ b/dlls/ole32/ole2.c
@@ -450,12 +450,17 @@ HRESULT WINAPI RegisterDragDrop(HWND hwnd, LPDROPTARGET pDropTarget)
   hr = CreateStreamOnHGlobal(NULL, TRUE, &stream);
   if(FAILED(hr)) return hr;
 
+  unk = NULL;
   hr = IDropTarget_QueryInterface(pDropTarget, &IID_IUnknown, (void**)&unk);
   if(FAILED(hr))
   {
       IStream_Release(stream);
       return hr;
   }
+  if (!unk) {
+      FIXME("hr was %d, but unk is NULL?\n", hr);
+      return E_FAIL;
+  }
   hr = CoMarshalInterface(stream, &IID_IDropTarget, unk, MSHCTX_LOCAL, NULL, MSHLFLAGS_TABLESTRONG);
   IUnknown_Release(unk);
 
-- 
1.5.6




More information about the wine-patches mailing list