From fbe682a22a28996f5f9e2c7a892545887a52d3cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Hentschel?= Date: Sun, 28 Oct 2012 16:16:45 +0100 Subject: [PATCH] ole32: Don't leak memory allocated by ProgIDFromCLSID (coverity). --- dlls/ole32/clipboard.c | 1 + dlls/ole32/storage32.c | 1 + 2 files changed, 2 insertions(+) diff --git a/dlls/ole32/clipboard.c b/dlls/ole32/clipboard.c index 57b0c46f494..a7308c25251 100644 --- a/dlls/ole32/clipboard.c +++ b/dlls/ole32/clipboard.c @@ -664,6 +664,7 @@ static HRESULT render_embed_source_hack(IDataObject *data, LPFORMATETC fmt) WideCharToMultiByte( CP_ACP, 0, strProgID, -1, strOleTypeName, sizeof(strOleTypeName), NULL, NULL ); STORAGE_CreateOleStream(std.u.pstg, 0); OLECONVERT_CreateCompObjStream(std.u.pstg, strOleTypeName); + CoTaskMemFree(strProgID); } } diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c index 70494a18ab2..d2e9f698402 100644 --- a/dlls/ole32/storage32.c +++ b/dlls/ole32/storage32.c @@ -9075,6 +9075,7 @@ static HRESULT OLECONVERT_GetOLE10ProgID(LPSTORAGE pStorage, char *strProgID, DW if(hRes == S_OK) { *dwSize = WideCharToMultiByte(CP_ACP, 0, wstrProgID, -1, strProgID, *dwSize, NULL, FALSE); + CoTaskMemFree(wstrProgID); } }