aboutsummaryrefslogtreecommitdiff
path: root/ui/shader.c
diff options
context:
space:
mode:
authorMd Haris Iqbal <haris.phnx@gmail.com>2016-04-05 18:51:39 +0530
committerGerd Hoffmann <kraxel@redhat.com>2016-05-12 16:41:46 +0200
commit42ddb8aa7c0ad727537db0f1b25c7640b36ef35e (patch)
tree9cd2d8bf500880ddbfdef0d63b153119e74d9040 /ui/shader.c
parent39414ef4e93db9041e463a097084a407d0d374f0 (diff)
Changed malloc to g_malloc, free to g_free in ui/shader.c
Signed-off-by: Md Haris Iqbal <haris.phnx@gmail.com> Message-id: 1459862499-4768-1-git-send-email-haris.phnx@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ui/shader.c')
-rw-r--r--ui/shader.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ui/shader.c b/ui/shader.c
index 9264009b80..1ffddbef3b 100644
--- a/ui/shader.c
+++ b/ui/shader.c
@@ -83,12 +83,12 @@ GLuint qemu_gl_create_compile_shader(GLenum type, const GLchar *src)
glGetShaderiv(shader, GL_COMPILE_STATUS, &status);
if (!status) {
glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &length);
- errmsg = malloc(length);
+ errmsg = g_malloc(length);
glGetShaderInfoLog(shader, length, &length, errmsg);
fprintf(stderr, "%s: compile %s error\n%s\n", __func__,
(type == GL_VERTEX_SHADER) ? "vertex" : "fragment",
errmsg);
- free(errmsg);
+ g_free(errmsg);
return 0;
}
return shader;
@@ -108,10 +108,10 @@ GLuint qemu_gl_create_link_program(GLuint vert, GLuint frag)
glGetProgramiv(program, GL_LINK_STATUS, &status);
if (!status) {
glGetProgramiv(program, GL_INFO_LOG_LENGTH, &length);
- errmsg = malloc(length);
+ errmsg = g_malloc(length);
glGetProgramInfoLog(program, length, &length, errmsg);
fprintf(stderr, "%s: link program: %s\n", __func__, errmsg);
- free(errmsg);
+ g_free(errmsg);
return 0;
}
return program;