From 602b58ba73f9042f88d5cc7074bfe33217576a54 Mon Sep 17 00:00:00 2001 From: Rob Shearman Date: Sun, 17 Aug 2008 18:28:24 +0100 Subject: [PATCH] hhctl.ocx: Fix reference count leak in InPlace_OnPosRectChange. Also compare the result of IOleObject_QueryInterface with S_OK instead of using not operator so it is more clear what the code is doing. --- dlls/hhctrl.ocx/webbrowser.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dlls/hhctrl.ocx/webbrowser.c b/dlls/hhctrl.ocx/webbrowser.c index c9caa38f1fa..5033197c0a8 100644 --- a/dlls/hhctrl.ocx/webbrowser.c +++ b/dlls/hhctrl.ocx/webbrowser.c @@ -365,8 +365,12 @@ static HRESULT STDMETHODCALLTYPE InPlace_OnPosRectChange(IOleInPlaceSite *iface, ICOM_THIS_MULTI(IOleClientSiteImpl, lpvtblOleInPlaceSite, iface); IOleInPlaceObject *inplace; - if (!IOleObject_QueryInterface(This->pBrowserObject, &IID_IOleInPlaceObject, (void **)&inplace)) + if (IOleObject_QueryInterface(This->pBrowserObject, &IID_IOleInPlaceObject, + (void **)&inplace) == S_OK) + { IOleInPlaceObject_SetObjectRects(inplace, lprcPosRect, lprcPosRect); + IOleInPlaceObject_Release(inplace); + } return S_OK; }