Module: wine Branch: master Commit: 92dbc57a7705b8e4b7d2e6d4e5176e59dd456d16 URL: http://source.winehq.org/git/wine.git/?a=commit;h=92dbc57a7705b8e4b7d2e6d4e5...
Author: Nikolay Sivov nsivov@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; }