mshtml: Avoid memory leaks (Coverity).
This commit is contained in:
parent
60ecf707a7
commit
60a592b77a
|
@ -635,7 +635,7 @@ static HRESULT WINAPI HTMLBodyElement_put_scroll(IHTMLBodyElement *iface, BSTR v
|
||||||
static HRESULT WINAPI HTMLBodyElement_get_scroll(IHTMLBodyElement *iface, BSTR *p)
|
static HRESULT WINAPI HTMLBodyElement_get_scroll(IHTMLBodyElement *iface, BSTR *p)
|
||||||
{
|
{
|
||||||
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
|
||||||
const WCHAR *ret;
|
const WCHAR *ret = NULL;
|
||||||
BSTR overflow;
|
BSTR overflow;
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
|
|
||||||
|
@ -648,7 +648,7 @@ static HRESULT WINAPI HTMLBodyElement_get_scroll(IHTMLBodyElement *iface, BSTR *
|
||||||
|
|
||||||
if(!overflow || !*overflow) {
|
if(!overflow || !*overflow) {
|
||||||
*p = NULL;
|
*p = NULL;
|
||||||
return S_OK;
|
hres = S_OK;
|
||||||
}else if(!strcmpW(overflow, visibleW) || !strcmpW(overflow, autoW)) {
|
}else if(!strcmpW(overflow, visibleW) || !strcmpW(overflow, autoW)) {
|
||||||
ret = autoW;
|
ret = autoW;
|
||||||
}else if(!strcmpW(overflow, scrollW)) {
|
}else if(!strcmpW(overflow, scrollW)) {
|
||||||
|
@ -658,11 +658,16 @@ static HRESULT WINAPI HTMLBodyElement_get_scroll(IHTMLBodyElement *iface, BSTR *
|
||||||
}else {
|
}else {
|
||||||
TRACE("Defaulting %s to NULL\n", debugstr_w(overflow));
|
TRACE("Defaulting %s to NULL\n", debugstr_w(overflow));
|
||||||
*p = NULL;
|
*p = NULL;
|
||||||
return S_OK;
|
hres = S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
*p = SysAllocString(ret);
|
SysFreeString(overflow);
|
||||||
return *p ? S_OK : E_OUTOFMEMORY;
|
if(ret) {
|
||||||
|
*p = SysAllocString(ret);
|
||||||
|
hres = *p ? S_OK : E_OUTOFMEMORY;
|
||||||
|
}
|
||||||
|
|
||||||
|
return hres;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI HTMLBodyElement_put_onselect(IHTMLBodyElement *iface, VARIANT v)
|
static HRESULT WINAPI HTMLBodyElement_put_onselect(IHTMLBodyElement *iface, VARIANT v)
|
||||||
|
|
Loading…
Reference in New Issue