Index: /trunk/src/VBox/Main/MachineImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/MachineImpl.cpp	(revision 23908)
+++ /trunk/src/VBox/Main/MachineImpl.cpp	(revision 23909)
@@ -2743,5 +2743,5 @@
 
     /* start with nothing found */
-    Bstr("").cloneTo(aValue);
+    Utf8Str strResult;
 
     AutoReadLock alock (this);
@@ -2749,9 +2749,9 @@
     settings::ExtraDataItemsMap::const_iterator it = mData->m_pMachineConfigFile->mapExtraDataItems.find(Utf8Str(aKey));
     if (it != mData->m_pMachineConfigFile->mapExtraDataItems.end())
-    {
         // found:
-        const Utf8Str &strValue = it->second;
-        strValue.cloneTo(aValue);
-    }
+        strResult = it->second;
+
+    /* return the result to caller (may be empty) */
+    strResult.cloneTo(aValue);
 
     return S_OK;
Index: /trunk/src/VBox/Main/VirtualBoxImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/VirtualBoxImpl.cpp	(revision 23908)
+++ /trunk/src/VBox/Main/VirtualBoxImpl.cpp	(revision 23909)
@@ -1607,13 +1607,13 @@
 
     /* start with nothing found */
-    Bstr("").cloneTo(aValue);
+    Utf8Str strResult;
 
     settings::ExtraDataItemsMap::const_iterator it = m->pMainConfigFile->mapExtraDataItems.find(Utf8Str(aKey));
     if (it != m->pMainConfigFile->mapExtraDataItems.end())
-    {
         // found:
-        const Utf8Str &strValue = it->second;
-        strValue.cloneTo(aValue);
-    }
+        strResult = it->second;
+
+    /* return the result to caller (may be empty) */
+    strResult.cloneTo(aValue);
 
     return S_OK;
