Index: /trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.cpp	(revision 31002)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.cpp	(revision 31003)
@@ -470,5 +470,5 @@
 int VBoxVHWAGlShader::init()
 {
-    int rc;
+    int rc = VERR_GENERAL_FAILURE;
     GLint *length;
     const char **sources;
@@ -481,5 +481,5 @@
         AssertRC(rc);
         if(RT_FAILURE(rc))
-            return rc;
+            goto exit;
         sources[i] = maComponents[i]->contents();
     }
@@ -512,5 +512,5 @@
     vboxglGetShaderInfoLog(mShader, 16300, NULL, pBuf);
     VBOXQGLLOG(("\ncompile log:\n-----------\n%s\n---------\n", pBuf));
-    delete pBuf;
+    delete[] pBuf;
 #endif
 
@@ -518,5 +518,6 @@
     if(compiled)
     {
-        return VINF_SUCCESS;
+        rc = VINF_SUCCESS;
+        goto exit;
     }
 
@@ -527,7 +528,8 @@
     mShader = 0;
 
+exit:
     delete[] length;
     delete[] sources;
-    return VERR_GENERAL_FAILURE;
+    return rc;
 }
 
