Module: wine Branch: master Commit: 4edca3cf4d52e40b45e829bd817c98be5bd1831a URL: http://source.winehq.org/git/wine.git/?a=commit;h=4edca3cf4d52e40b45e829bd81...
Author: Rob Shearman rob@codeweavers.com Date: Mon Nov 12 20:10:32 2007 +0000
ole32: Fail before constructing an object in CreateStreamOnHGlobal to avoid a memory leak.
---
dlls/ole32/hglobalstream.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/dlls/ole32/hglobalstream.c b/dlls/ole32/hglobalstream.c index e6d2f73..2175214 100644 --- a/dlls/ole32/hglobalstream.c +++ b/dlls/ole32/hglobalstream.c @@ -721,6 +721,9 @@ HRESULT WINAPI CreateStreamOnHGlobal( { HGLOBALStreamImpl* newStream;
+ if (!ppstm) + return E_INVALIDARG; + newStream = HGLOBALStreamImpl_Construct(hGlobal, fDeleteOnRelease);