Correctly free memory.

Change-Id: I08fcbfa7d27ae413e0a8e8ca6ea305c8530a72c1
diff --git a/libs/hwui/Line.h b/libs/hwui/Line.h
index 48e18eb..75f3321e 100644
--- a/libs/hwui/Line.h
+++ b/libs/hwui/Line.h
@@ -74,8 +74,8 @@
 
     ~Line() {
         delete mPatch;
-        delete mXDivs;
-        delete mYDivs;
+        delete[] mXDivs;
+        delete[] mYDivs;
 
         glDeleteTextures(1, &mTexture);
     }
diff --git a/libs/hwui/Patch.cpp b/libs/hwui/Patch.cpp
index 0a6eca3..ca0a0b1 100644
--- a/libs/hwui/Patch.cpp
+++ b/libs/hwui/Patch.cpp
@@ -34,7 +34,7 @@
 }
 
 Patch::~Patch() {
-    delete vertices;
+    delete[] vertices;
 }
 
 ///////////////////////////////////////////////////////////////////////////////
diff --git a/libs/hwui/Program.cpp b/libs/hwui/Program.cpp
index 6528d91..2e1b9a0 100644
--- a/libs/hwui/Program.cpp
+++ b/libs/hwui/Program.cpp
@@ -46,10 +46,9 @@
         GLint infoLen = 0;
         glGetProgramiv(id, GL_INFO_LOG_LENGTH, &infoLen);
         if (infoLen > 1) {
-            char* log = (char*) malloc(sizeof(char) * infoLen);
-            glGetProgramInfoLog(id, infoLen, 0, log);
+            GLchar log[infoLen];
+            glGetProgramInfoLog(id, infoLen, 0, &log[0]);
             LOGE("Error while linking shaders: %s", log);
-            delete log;
         }
         glDeleteShader(vertexShader);
         glDeleteShader(fragmentShader);