Nikolay Sivov : ole32: Handle ILockBytes creation failure (PVS-Studio).
Module: wine Branch: master Commit: 1c2bbe8f650b79d827ecad9277c6e02baf6f152e URL: http://source.winehq.org/git/wine.git/?a=commit;h=1c2bbe8f650b79d827ecad9277... Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sat Mar 14 01:15:59 2015 +0300 ole32: Handle ILockBytes creation failure (PVS-Studio). --- dlls/ole32/clipboard.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlls/ole32/clipboard.c b/dlls/ole32/clipboard.c index c7d58d6..db1e4a8 100644 --- a/dlls/ole32/clipboard.c +++ b/dlls/ole32/clipboard.c @@ -576,6 +576,12 @@ static HRESULT render_embed_source_hack(IDataObject *data, LPFORMATETC fmt) hStorage = GlobalAlloc(GMEM_SHARE|GMEM_MOVEABLE, 0); if (hStorage == NULL) return E_OUTOFMEMORY; hr = CreateILockBytesOnHGlobal(hStorage, FALSE, &ptrILockBytes); + if (FAILED(hr)) + { + GlobalFree(hStorage); + return hr; + } + hr = StgCreateDocfileOnILockBytes(ptrILockBytes, STGM_SHARE_EXCLUSIVE|STGM_READWRITE, 0, &std.u.pstg); ILockBytes_Release(ptrILockBytes);
participants (1)
-
Alexandre Julliard