Index: /trunk/src/VBox/Main/cbinding/VBoxCAPI.cpp
===================================================================
--- /trunk/src/VBox/Main/cbinding/VBoxCAPI.cpp	(revision 55751)
+++ /trunk/src/VBox/Main/cbinding/VBoxCAPI.cpp	(revision 55752)
@@ -210,4 +210,25 @@
     return S_OK;
 #else /* !VBOX_WITH_XPCOM */
+    VARTYPE vt = VT_UNKNOWN;
+    HRESULT rc = SafeArrayGetVartype(psa, &vt);
+    if (FAILED(rc))
+        return rc;
+    if (vt == VT_BSTR)
+    {
+        /* Special treatment: strings are to be freed explicitly, see sample
+         * C binding code, so zap it here. No way to reach compatible code
+         * behavior between COM and XPCOM without this kind of trickery. */
+        void *pData;
+        rc = SafeArrayAccessData(psa, &pData);
+        if (FAILED(rc))
+            return rc;
+        ULONG cbElement = VBoxVTElemSize(vt);
+        if (!cbElement)
+            return E_INVALIDARG;
+        Assert(cbElement = psa->cbElements);
+        ULONG cElements = psa->rgsabound[0].cElements;
+        memset(pData, '\0', cbElement * cElements);
+        SafeArrayUnaccessData(psa);
+    }
     return SafeArrayDestroy(psa);
 #endif /* !VBOX_WITH_XPCOM */
Index: /trunk/src/VBox/Main/cbinding/tstCAPIGlue.c
===================================================================
--- /trunk/src/VBox/Main/cbinding/tstCAPIGlue.c	(revision 55751)
+++ /trunk/src/VBox/Main/cbinding/tstCAPIGlue.c	(revision 55752)
@@ -9,5 +9,5 @@
 
 /*
- * Copyright (C) 2009-2014 Oracle Corporation
+ * Copyright (C) 2009-2015 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -756,4 +756,5 @@
         ULONG i, cGroups;
         g_pVBoxFuncs->pfnSafeArrayCopyOutParamHelper((void **)&groups, &cbGroups, VT_BSTR, groupsSA);
+        g_pVBoxFuncs->pfnSafeArrayDestroy(groupsSA);
         cGroups = cbGroups / sizeof(groups[0]);
         for (i = 0; i < cGroups; ++i)
