ole32: Allocate a small temp variable on the stack instead of the heap.

This commit is contained in:
Michael Stefaniuc 2010-09-28 22:43:50 +02:00 committed by Alexandre Julliard
parent ef104dc465
commit 620ca68d01
1 changed files with 10 additions and 12 deletions

View File

@ -2530,19 +2530,17 @@ HRESULT WINAPI OleCreate(
if (SUCCEEDED(hres2))
{
DWORD dwConnection;
FORMATETC *pfe;
if (renderopt == OLERENDER_DRAW && !pFormatEtc) {
pfe = HeapAlloc(GetProcessHeap(), 0, sizeof(FORMATETC));
pfe->cfFormat = 0;
pfe->ptd = NULL;
pfe->dwAspect = DVASPECT_CONTENT;
pfe->lindex = -1;
pfe->tymed = TYMED_NULL;
}else
pfe = pFormatEtc;
hres = IOleCache_Cache(pOleCache, pfe, ADVF_PRIMEFIRST, &dwConnection);
if (!pFormatEtc && pfe)
HeapFree(GetProcessHeap(), 0, pfe);
FORMATETC pfe;
pfe.cfFormat = 0;
pfe.ptd = NULL;
pfe.dwAspect = DVASPECT_CONTENT;
pfe.lindex = -1;
pfe.tymed = TYMED_NULL;
hres = IOleCache_Cache(pOleCache, &pfe, ADVF_PRIMEFIRST, &dwConnection);
}
else
hres = IOleCache_Cache(pOleCache, pFormatEtc, ADVF_PRIMEFIRST, &dwConnection);
IOleCache_Release(pOleCache);
}
}