diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c
index 7a4ebe3e23d..a445bc2c130 100644
--- a/dlls/mshtml/htmlstyle.c
+++ b/dlls/mshtml/htmlstyle.c
@@ -485,15 +485,13 @@ static HRESULT get_nsstyle_attr_nsval(nsIDOMCSSStyleDeclaration *nsstyle, stylei
nsresult nsres;
nsAString_InitDepend(&str_name, style_tbl[sid].name);
-
nsres = nsIDOMCSSStyleDeclaration_GetPropertyValue(nsstyle, &str_name, value);
+ nsAString_Finish(&str_name);
if(NS_FAILED(nsres)) {
ERR("SetProperty failed: %08x\n", nsres);
return E_FAIL;
}
- nsAString_Finish(&str_name);
-
return S_OK;
}