diff --git a/dlls/mshtml/nsembed.c b/dlls/mshtml/nsembed.c
index b8c47b860b6..3944333c683 100644
--- a/dlls/mshtml/nsembed.c
+++ b/dlls/mshtml/nsembed.c
@@ -594,11 +594,10 @@ static nsresult NSAPI nsURIContentListener_OnStartURIOpen(nsIURIContentListener
     NSContainer *This = NSURICL_THIS(iface);
     BOOL do_load = TRUE;
     nsresult nsres;
+    nsACString *spec_str = nsACString_Create();
 
     TRACE("(%p)->(%p %p)\n", This, aURI, _retval);
 
-    nsACString *spec_str = nsACString_Create();
-
     nsres = nsIURI_GetSpec(aURI, spec_str);
     if(NS_SUCCEEDED(nsres)) {
         const char *spec = NULL;