From 15a07c0725f0a2aa165d4ecc4b67633933563e85 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Thu, 10 Nov 2016 00:21:56 +0300 Subject: [PATCH] mshtml: Fix BSTR leak in SetReferrerWithPolicy() (Valgrind). Signed-off-by: Nikolay Sivov Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- dlls/mshtml/nsio.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/mshtml/nsio.c b/dlls/mshtml/nsio.c index 0e2a748daea..ba2131266fa 100644 --- a/dlls/mshtml/nsio.c +++ b/dlls/mshtml/nsio.c @@ -1343,8 +1343,10 @@ static nsresult NSAPI nsChannel_SetReferrerWithPolicy(nsIHttpChannel *iface, nsI } hres = IUri_GetDisplayUri(referrer->uri, &referrer_uri); - if(SUCCEEDED(hres) ) + if(SUCCEEDED(hres)) { set_http_header(&This->request_headers, refererW, sizeof(refererW)/sizeof(WCHAR), referrer_uri, SysStringLen(referrer_uri)); + SysFreeString(referrer_uri); + } This->referrer = (nsIURI*)&referrer->nsIFileURL_iface; return NS_OK;