Fix memory leak in OleDuplicateData on error path (found by Smatch).

This commit is contained in:
Robert Shearman 2005-03-19 17:05:12 +00:00 committed by Alexandre Julliard
parent 11f2cb1877
commit 1571df5722
1 changed files with 2 additions and 3 deletions

View File

@ -259,8 +259,7 @@ HANDLE WINAPI OleDuplicateData(HANDLE hSrc, CLIPFORMAT cfFormat,
if (!size) return NULL;
bm.bmBits = HeapAlloc(GetProcessHeap(), 0, size);
if (!bm.bmBits) return NULL;
if (!GetBitmapBits(hSrc, size, bm.bmBits))
return NULL;
if (GetBitmapBits(hSrc, size, bm.bmBits))
hDst = CreateBitmapIndirect(&bm);
HeapFree(GetProcessHeap(), 0, bm.bmBits);
break;