diff --git a/libs/hwui/Line.h b/libs/hwui/Line.h index 48e18eb4a63b9..75f3321e97765 100644 --- a/libs/hwui/Line.h +++ b/libs/hwui/Line.h @@ -74,8 +74,8 @@ public: ~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 0a6eca3b01be8..ca0a0b1691de7 100644 --- a/libs/hwui/Patch.cpp +++ b/libs/hwui/Patch.cpp @@ -34,7 +34,7 @@ Patch::Patch(const uint32_t xCount, const uint32_t yCount) { } Patch::~Patch() { - delete vertices; + delete[] vertices; } /////////////////////////////////////////////////////////////////////////////// diff --git a/libs/hwui/Program.cpp b/libs/hwui/Program.cpp index 6528d91501105..2e1b9a073e3d4 100644 --- a/libs/hwui/Program.cpp +++ b/libs/hwui/Program.cpp @@ -46,10 +46,9 @@ Program::Program(const char* vertex, const char* fragment) { 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);