mshtml: Fixed leaks (valgrind).
This commit is contained in:
parent
2309d9f06a
commit
60d8c48132
|
@ -228,17 +228,7 @@ static HRESULT WINAPI HTMLFormElement_get_encoding(IHTMLFormElement *iface, BSTR
|
||||||
|
|
||||||
nsAString_Init(&encoding_str, NULL);
|
nsAString_Init(&encoding_str, NULL);
|
||||||
nsres = nsIDOMHTMLFormElement_GetEnctype(This->nsform, &encoding_str);
|
nsres = nsIDOMHTMLFormElement_GetEnctype(This->nsform, &encoding_str);
|
||||||
if(NS_SUCCEEDED(nsres)) {
|
return return_nsstr(nsres, &encoding_str, p);
|
||||||
const PRUnichar *encoding;
|
|
||||||
nsAString_GetData(&encoding_str, &encoding);
|
|
||||||
|
|
||||||
*p = SysAllocString(encoding);
|
|
||||||
if(!*p)
|
|
||||||
return E_OUTOFMEMORY;
|
|
||||||
}else
|
|
||||||
return E_FAIL;
|
|
||||||
|
|
||||||
return S_OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI HTMLFormElement_put_method(IHTMLFormElement *iface, BSTR v)
|
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);
|
nsAString_Init(&method_str, NULL);
|
||||||
nsres = nsIDOMHTMLFormElement_GetMethod(This->nsform, &method_str);
|
nsres = nsIDOMHTMLFormElement_GetMethod(This->nsform, &method_str);
|
||||||
if(NS_SUCCEEDED(nsres)) {
|
return return_nsstr(nsres, &method_str, p);
|
||||||
const PRUnichar *method;
|
|
||||||
nsAString_GetData(&method_str, &method);
|
|
||||||
|
|
||||||
*p = SysAllocString(method);
|
|
||||||
if(!*p)
|
|
||||||
return E_OUTOFMEMORY;
|
|
||||||
}else
|
|
||||||
return E_FAIL;
|
|
||||||
|
|
||||||
return S_OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI HTMLFormElement_get_elements(IHTMLFormElement *iface, IDispatch **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);
|
nsAString_Init(&name_str, NULL);
|
||||||
nsres = nsIDOMHTMLFormElement_GetName(This->nsform, &name_str);
|
nsres = nsIDOMHTMLFormElement_GetName(This->nsform, &name_str);
|
||||||
if(NS_SUCCEEDED(nsres)) {
|
return return_nsstr(nsres, &name_str, p);
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI HTMLFormElement_put_onsubmit(IHTMLFormElement *iface, VARIANT v)
|
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));
|
MultiByteToWideChar(CP_ACP, 0, scheme, -1, buf, sizeof(buf)/sizeof(WCHAR));
|
||||||
*_retval = !strcmpW(scheme_name, buf);
|
*_retval = !strcmpW(scheme_name, buf);
|
||||||
|
SysFreeString(scheme_name);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue