Jacek Caban : mshtml: Fixed buffer handling in set_nsstyle_attr.

Alexandre Julliard julliard at winehq.org
Fri Feb 25 11:19:47 CST 2011


Module: wine
Branch: master
Commit: 3aa970c9ea0a83935064634efae35dc64cca477f
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=3aa970c9ea0a83935064634efae35dc64cca477f

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Fri Feb 25 14:11:26 2011 +0100

mshtml: Fixed buffer handling in set_nsstyle_attr.

---

 dlls/mshtml/htmlstyle.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c
index 7f1308c..1d57bc4 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;
 }




More information about the wine-cvs mailing list