mshtml: Fixed leaks (valgrind).

This commit is contained in:
Jacek Caban 2011-01-20 11:48:56 +01:00 committed by Alexandre Julliard
parent 2309d9f06a
commit 60d8c48132
2 changed files with 4 additions and 36 deletions

View File

@ -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)

View File

@ -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;
} }