From 89317f533b7c6d244301d0a83c20879a209b1409 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Fri, 7 Jan 2022 17:43:44 +0200 Subject: [PATCH] mshtml: Fix leak on failure in return_nsstr. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabriel Ivăncescu Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- dlls/mshtml/nsembed.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/mshtml/nsembed.c b/dlls/mshtml/nsembed.c index 25ad92d5ddf..32ae792625c 100644 --- a/dlls/mshtml/nsembed.c +++ b/dlls/mshtml/nsembed.c @@ -917,6 +917,7 @@ HRESULT map_nsresult(nsresult nsres) HRESULT return_nsstr(nsresult nsres, nsAString *nsstr, BSTR *p) { const PRUnichar *str; + HRESULT hres = S_OK; if(NS_FAILED(nsres)) { WARN("failed: %08x\n", nsres); @@ -929,13 +930,13 @@ HRESULT return_nsstr(nsresult nsres, nsAString *nsstr, BSTR *p) if(*str) { *p = SysAllocString(str); if(!*p) - return E_OUTOFMEMORY; + hres = E_OUTOFMEMORY; }else { *p = NULL; } nsAString_Finish(nsstr); - return S_OK; + return hres; } HRESULT return_nsstr_variant(nsresult nsres, nsAString *nsstr, unsigned flags, VARIANT *p)