From 3aa970c9ea0a83935064634efae35dc64cca477f Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Fri, 25 Feb 2011 14:11:26 +0100 Subject: [PATCH] mshtml: Fixed buffer handling in set_nsstyle_attr. --- dlls/mshtml/htmlstyle.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index 7f1308c5c29..1d57bc47293 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -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; }