Index: /trunk/src/VBox/Storage/VMDK.cpp
===================================================================
--- /trunk/src/VBox/Storage/VMDK.cpp	(revision 33936)
+++ /trunk/src/VBox/Storage/VMDK.cpp	(revision 33937)
@@ -2576,17 +2576,18 @@
         if (RT_FAILURE(rc))
             rc = vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: error writing descriptor in '%s'"), pImage->pszFilename);
-    }
-
-    if (RT_SUCCESS(rc) && !cbLimit)
-    {
-        rc = vmdkFileSetSize(pImage, pDescFile, cbDescriptor);
-        if (RT_FAILURE(rc))
-            rc = vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: error truncating descriptor in '%s'"), pImage->pszFilename);
-    }
-
-    if (RT_SUCCESS(rc))
-        pImage->Descriptor.fDirty = false;
-
-    RTMemFree(pvDescriptor);
+
+        if (RT_SUCCESS(rc) && !cbLimit)
+        {
+            rc = vmdkFileSetSize(pImage, pDescFile, cbDescriptor);
+            if (RT_FAILURE(rc))
+                rc = vmdkError(pImage, rc, RT_SRC_POS, N_("VMDK: error truncating descriptor in '%s'"), pImage->pszFilename);
+        }
+
+        if (RT_SUCCESS(rc))
+            pImage->Descriptor.fDirty = false;
+
+        RTMemFree(pvDescriptor);
+    }
+
     return rc;
 }
