Module: wine Branch: master Commit: aba6a680680c493add66f969a3a39b28f3a39779 URL: http://source.winehq.org/git/wine.git/?a=commit;h=aba6a680680c493add66f969a3...
Author: Sebastian Lackner sebastian@fds-team.de Date: Thu Feb 26 06:29:51 2015 +0100
shell32: Fix memory leak in ApplicationAssociationRegistration_QueryCurrentDefault.
---
dlls/shell32/assoc.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/dlls/shell32/assoc.c b/dlls/shell32/assoc.c index 528666e..686c323 100644 --- a/dlls/shell32/assoc.c +++ b/dlls/shell32/assoc.c @@ -916,6 +916,11 @@ static HRESULT WINAPI ApplicationAssociationRegistration_QueryCurrentDefault(IAp ret = RegGetValueW(hkey, NULL, NULL, RRF_RT_REG_SZ, &keytype, *association, &size); if(ret == ERROR_SUCCESS) hr = S_OK; + else + { + CoTaskMemFree(*association); + *association = NULL; + } } else hr = E_OUTOFMEMORY; @@ -952,6 +957,11 @@ static HRESULT WINAPI ApplicationAssociationRegistration_QueryCurrentDefault(IAp ret = RegGetValueW(hkey, path, propid, RRF_RT_REG_SZ, &keytype, *association, &size); if(ret == ERROR_SUCCESS) hr = S_OK; + else + { + CoTaskMemFree(*association); + *association = NULL; + } } else hr = E_OUTOFMEMORY;