From 05649af8f1f88402a570883f120ab40424a51928 Mon Sep 17 00:00:00 2001 From: Christoph von Wittich Date: Fri, 4 Sep 2015 11:43:48 +0000 Subject: [PATCH] [SHELL32] fix a memory leak CID 1322145 svn path=/trunk/; revision=68988 --- reactos/dll/win32/shell32/CQueryAssociations.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/reactos/dll/win32/shell32/CQueryAssociations.cpp b/reactos/dll/win32/shell32/CQueryAssociations.cpp index ae4651efa49..3dde87f3f54 100644 --- a/reactos/dll/win32/shell32/CQueryAssociations.cpp +++ b/reactos/dll/win32/shell32/CQueryAssociations.cpp @@ -474,11 +474,17 @@ HRESULT STDMETHODCALLTYPE CQueryAssociations::GetData(ASSOCF cfFlags, ASSOCDATA void *data; DWORD size; HRESULT hres = this->GetValue(this->hkeyProgID, edit_flags, &data, &size); - if(FAILED(hres) || !pcbOut) + if(FAILED(hres)) { return hres; } + if (!pcbOut) + { + HeapFree(GetProcessHeap(), 0, data); + return hres; + } + hres = this->ReturnData(pvOut, pcbOut, data, size); HeapFree(GetProcessHeap(), 0, data); return hres;