Nikolay Sivov : oleaut32: Fix a stream leak on failure.

Alexandre Julliard julliard at winehq.org
Thu Jan 20 12:41:20 CST 2011


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

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Thu Jan 20 00:38:16 2011 +0300

oleaut32: Fix a stream leak on failure.

---

 dlls/oleaut32/tmarshal.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/dlls/oleaut32/tmarshal.c b/dlls/oleaut32/tmarshal.c
index 9d3d73e..6536bb4 100644
--- a/dlls/oleaut32/tmarshal.c
+++ b/dlls/oleaut32/tmarshal.c
@@ -153,6 +153,7 @@ _unmarshal_interface(marshal_state *buf, REFIID riid, LPUNKNOWN *pUnk) {
     hres = IStream_Write(pStm,buf->base+buf->curoff,xsize,&res);
     if (hres) {
         ERR("stream write %x\n",hres);
+        IStream_Release(pStm);
         return hres;
     }
     
@@ -160,12 +161,14 @@ _unmarshal_interface(marshal_state *buf, REFIID riid, LPUNKNOWN *pUnk) {
     hres = IStream_Seek(pStm,seekto,SEEK_SET,&newpos);
     if (hres) {
         ERR("Failed Seek %x\n",hres);
+        IStream_Release(pStm);
         return hres;
     }
     
     hres = CoUnmarshalInterface(pStm,riid,(LPVOID*)pUnk);
     if (hres) {
 	ERR("Unmarshalling interface %s failed with %x\n",debugstr_guid(riid),hres);
+	IStream_Release(pStm);
 	return hres;
     }
     




More information about the wine-cvs mailing list