Michael Stefaniuc : ole32: Free memory on error path (found by Smatch).

Alexandre Julliard julliard at winehq.org
Tue Sep 25 07:50:47 CDT 2007


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

Author: Michael Stefaniuc <mstefani at redhat.de>
Date:   Tue Sep 25 01:15:07 2007 +0200

ole32: Free memory on error path (found by Smatch).

---

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

diff --git a/dlls/ole32/oleproxy.c b/dlls/ole32/oleproxy.c
index e807941..42dc8d1 100644
--- a/dlls/ole32/oleproxy.c
+++ b/dlls/ole32/oleproxy.c
@@ -402,9 +402,10 @@ static HRESULT WINAPI CFProxy_CreateInstance(
     hGlobal = GlobalAlloc(GMEM_MOVEABLE|GMEM_NODISCARD|GMEM_SHARE,msg.cbBuffer);
     memcpy(GlobalLock(hGlobal),msg.Buffer,msg.cbBuffer);
     hres = CreateStreamOnHGlobal(hGlobal,TRUE,&pStream);
-    if (hres) {
+    if (hres != S_OK) {
 	FIXME("CreateStreamOnHGlobal failed with %x\n",hres);
 	IRpcChannelBuffer_FreeBuffer(This->chanbuf,&msg);
+        GlobalFree(hGlobal);
 	return hres;
     }
     hres = IStream_Read(pStream, ppv, sizeof(*ppv), NULL);




More information about the wine-cvs mailing list