Index: /trunk/src/VBox/Main/MachineImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/MachineImpl.cpp	(revision 31224)
+++ /trunk/src/VBox/Main/MachineImpl.cpp	(revision 31225)
@@ -4076,4 +4076,6 @@
                            mUserData->mName.raw());
 
+    HRESULT rc = S_OK;
+
     // this list collects the files that should be reported
     // as to be deleted to the caller in aFiles
@@ -4126,7 +4128,7 @@
                     llMedia.push_back(pMedium);
 
-                HRESULT rc = detachDevice(pAttach,
-                                          alock,
-                                          NULL /* pfNeedsSaveSettings */);
+                rc = detachDevice(pAttach,
+                                  alock,
+                                  NULL /* pfNeedsSaveSettings */);
                 if (FAILED(rc))
                     break;
@@ -4167,6 +4169,6 @@
 
             ErrorInfoKeeper eik;
-            HRESULT rc = pMedium->close(NULL /*fNeedsSaveSettings*/,     // we'll call saveSettings() in any case below
-                                        autoCaller2);
+            rc = pMedium->close(NULL /*fNeedsSaveSettings*/,     // we'll call saveSettings() in any case below
+                                autoCaller2);
                 // this uninitializes the medium
 
