mshtml: Fixed buffer handling in set_nsstyle_attr.

This commit is contained in:
Jacek Caban 2011-02-25 14:11:26 +01:00 committed by Alexandre Julliard
parent b5d68c70d3
commit 3aa970c9ea
1 changed files with 2 additions and 4 deletions

View File

@ -314,8 +314,6 @@ HRESULT set_nsstyle_attr(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, LPCW
LPWSTR val = NULL;
nsresult nsres;
static const PRUnichar wszEmpty[] = {0};
if(flags & ATTR_FIX_PX)
val = fix_px_value(value);
if(flags & ATTR_FIX_URL)
@ -323,8 +321,7 @@ HRESULT set_nsstyle_attr(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, LPCW
nsAString_InitDepend(&str_name, style_tbl[sid].name);
nsAString_InitDepend(&str_value, val ? val : value);
nsAString_InitDepend(&str_empty, wszEmpty);
heap_free(val);
nsAString_InitDepend(&str_empty, emptyW);
nsres = nsIDOMCSSStyleDeclaration_SetProperty(nsstyle, &str_name, &str_value, &str_empty);
if(NS_FAILED(nsres))
@ -333,6 +330,7 @@ HRESULT set_nsstyle_attr(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, LPCW
nsAString_Finish(&str_name);
nsAString_Finish(&str_value);
nsAString_Finish(&str_empty);
heap_free(val);
return S_OK;
}