Commit 1571df57 authored by Robert Shearman's avatar Robert Shearman Committed by Alexandre Julliard

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

parent 11f2cb18
...@@ -259,9 +259,8 @@ HANDLE WINAPI OleDuplicateData(HANDLE hSrc, CLIPFORMAT cfFormat, ...@@ -259,9 +259,8 @@ HANDLE WINAPI OleDuplicateData(HANDLE hSrc, CLIPFORMAT cfFormat,
if (!size) return NULL; if (!size) return NULL;
bm.bmBits = HeapAlloc(GetProcessHeap(), 0, size); bm.bmBits = HeapAlloc(GetProcessHeap(), 0, size);
if (!bm.bmBits) return NULL; if (!bm.bmBits) return NULL;
if (!GetBitmapBits(hSrc, size, bm.bmBits)) if (GetBitmapBits(hSrc, size, bm.bmBits))
return NULL; hDst = CreateBitmapIndirect(&bm);
hDst = CreateBitmapIndirect(&bm);
HeapFree(GetProcessHeap(), 0, bm.bmBits); HeapFree(GetProcessHeap(), 0, bm.bmBits);
break; break;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment