mshtml: Fix use after free in use_gecko_script (Coverity).

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alex Henrie 2021-12-29 22:56:38 -07:00 committed by Alexandre Julliard
parent 45b9dccb70
commit 4ef2557d87
1 changed files with 2 additions and 1 deletions
dlls/mshtml

View File

@ -1716,12 +1716,13 @@ static BOOL use_gecko_script(IUri *uri)
return FALSE;
hres = IInternetSecurityManager_MapUrlToZone(get_security_manager(), display_uri, &zone, 0);
SysFreeString(display_uri);
if(FAILED(hres)) {
WARN("Could not map %s to zone: %08x\n", debugstr_w(display_uri), hres);
SysFreeString(display_uri);
return TRUE;
}
SysFreeString(display_uri);
TRACE("zone %d\n", zone);
return zone == URLZONE_UNTRUSTED;
}