Module: wine Branch: master Commit: 2dbb23c8109e5c82dfe4221a9b95c8c3d586d384 URL: http://source.winehq.org/git/wine.git/?a=commit;h=2dbb23c8109e5c82dfe4221a9b...
Author: Marcus Meissner marcus@jet.franken.de Date: Sat Feb 16 17:46:04 2013 +0100
ole32: Free *ppszProgID on error path (Coverity).
---
dlls/ole32/compobj.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/dlls/ole32/compobj.c b/dlls/ole32/compobj.c index dc2a02b..17bd7a1 100644 --- a/dlls/ole32/compobj.c +++ b/dlls/ole32/compobj.c @@ -2033,8 +2033,11 @@ HRESULT WINAPI ProgIDFromCLSID(REFCLSID clsid, LPOLESTR *ppszProgID) *ppszProgID = CoTaskMemAlloc(progidlen * sizeof(WCHAR)); if (*ppszProgID) { - if (RegQueryValueW(hkey, NULL, *ppszProgID, &progidlen)) + if (RegQueryValueW(hkey, NULL, *ppszProgID, &progidlen)) { ret = REGDB_E_CLASSNOTREG; + CoTaskMemFree(*ppszProgID); + *ppszProgID = NULL; + } } else ret = E_OUTOFMEMORY;