Rob Shearman : ole32: Fix a memory leak.

Alexandre Julliard julliard at winehq.org
Mon Jan 7 16:25:00 CST 2008


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

Author: Rob Shearman <rob at codeweavers.com>
Date:   Mon Jan  7 17:15:08 2008 +0000

ole32: Fix a memory leak.

---

 dlls/ole32/oleproxy.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/dlls/ole32/oleproxy.c b/dlls/ole32/oleproxy.c
index bc87997..d37c2cf 100644
--- a/dlls/ole32/oleproxy.c
+++ b/dlls/ole32/oleproxy.c
@@ -574,9 +574,11 @@ static HRESULT WINAPI RemUnkStub_Invoke(LPRPCSTUBBUFFER iface,
     *(HRESULT *)buf = hr;
     buf += sizeof(HRESULT);
     
-    if (hr) return hr;
-    /* FIXME: pQIResults is a unique pointer so pQIResults can be NULL! */
-    memcpy(buf, pQIResults, cIids * sizeof(REMQIRESULT));
+    if (hr == S_OK)
+      /* FIXME: pQIResults is a unique pointer so pQIResults can be NULL! */
+      memcpy(buf, pQIResults, cIids * sizeof(REMQIRESULT));
+
+    CoTaskMemFree(pQIResults);
 
     break;
   }




More information about the wine-cvs mailing list