Module: wine Branch: master Commit: 7ca31b81195ac39ddb3feb49624b57a7d92da994 URL: http://source.winehq.org/git/wine.git/?a=commit;h=7ca31b81195ac39ddb3feb4962...
Author: Nikolay Sivov nsivov@codeweavers.com Date: Sat Jun 27 22:07:39 2015 +0300
shell32: Fix memory leak on NULL return length (Coverity).
---
dlls/shell32/assoc.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/dlls/shell32/assoc.c b/dlls/shell32/assoc.c index 21df493..90d00a8 100644 --- a/dlls/shell32/assoc.c +++ b/dlls/shell32/assoc.c @@ -745,7 +745,7 @@ static HRESULT WINAPI IQueryAssociations_fnGetData(IQueryAssociations *iface, static const WCHAR edit_flags[] = {'E','d','i','t','F','l','a','g','s',0};
IQueryAssociationsImpl *This = impl_from_IQueryAssociations(iface); - void *data; + void *data = NULL; DWORD size; HRESULT hres;
@@ -761,10 +761,8 @@ static HRESULT WINAPI IQueryAssociations_fnGetData(IQueryAssociations *iface, return HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION);
hres = ASSOC_GetValue(This->hkeyProgID, edit_flags, &data, &size); - if(FAILED(hres) || !pcbOut) - return hres; - - hres = ASSOC_ReturnData(pvOut, pcbOut, data, size); + if(SUCCEEDED(hres) && pcbOut) + hres = ASSOC_ReturnData(pvOut, pcbOut, data, size); HeapFree(GetProcessHeap(), 0, data); return hres; default: