Commit 60d8c481 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Fixed leaks (valgrind).

parent 2309d9f0
......@@ -228,17 +228,7 @@ static HRESULT WINAPI HTMLFormElement_get_encoding(IHTMLFormElement *iface, BSTR
nsAString_Init(&encoding_str, NULL);
nsres = nsIDOMHTMLFormElement_GetEnctype(This->nsform, &encoding_str);
if(NS_SUCCEEDED(nsres)) {
const PRUnichar *encoding;
nsAString_GetData(&encoding_str, &encoding);
*p = SysAllocString(encoding);
if(!*p)
return E_OUTOFMEMORY;
}else
return E_FAIL;
return S_OK;
return return_nsstr(nsres, &encoding_str, p);
}
static HRESULT WINAPI HTMLFormElement_put_method(IHTMLFormElement *iface, BSTR v)
......@@ -276,17 +266,7 @@ static HRESULT WINAPI HTMLFormElement_get_method(IHTMLFormElement *iface, BSTR *
nsAString_Init(&method_str, NULL);
nsres = nsIDOMHTMLFormElement_GetMethod(This->nsform, &method_str);
if(NS_SUCCEEDED(nsres)) {
const PRUnichar *method;
nsAString_GetData(&method_str, &method);
*p = SysAllocString(method);
if(!*p)
return E_OUTOFMEMORY;
}else
return E_FAIL;
return S_OK;
return return_nsstr(nsres, &method_str, p);
}
static HRESULT WINAPI HTMLFormElement_get_elements(IHTMLFormElement *iface, IDispatch **p)
......@@ -337,20 +317,7 @@ static HRESULT WINAPI HTMLFormElement_get_name(IHTMLFormElement *iface, BSTR *p)
nsAString_Init(&name_str, NULL);
nsres = nsIDOMHTMLFormElement_GetName(This->nsform, &name_str);
if(NS_SUCCEEDED(nsres)) {
const PRUnichar *name;
nsAString_GetData(&name_str, &name);
if(*name) {
*p = SysAllocString(name);
if(!*p)
return E_OUTOFMEMORY;
}else
*p = NULL;
}else
return E_FAIL;
return S_OK;
return return_nsstr(nsres, &name_str, p);
}
static HRESULT WINAPI HTMLFormElement_put_onsubmit(IHTMLFormElement *iface, VARIANT v)
......
......@@ -2007,6 +2007,7 @@ static nsresult NSAPI nsURI_SchemeIs(nsIURL *iface, const char *scheme, PRBool *
MultiByteToWideChar(CP_ACP, 0, scheme, -1, buf, sizeof(buf)/sizeof(WCHAR));
*_retval = !strcmpW(scheme_name, buf);
SysFreeString(scheme_name);
return NS_OK;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment