From: Md Haris Iqbal <haris.phnx@gmail.com>
To: qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org, Md Haris Iqbal <haris.phnx@gmail.com>,
kraxel@redhat.com
Subject: [Qemu-devel] [PATCH v1] Changed malloc to g_malloc, free to g_free in ui/shader.c
Date: Tue, 5 Apr 2016 18:51:39 +0530 [thread overview]
Message-ID: <1459862499-4768-1-git-send-email-haris.phnx@gmail.com> (raw)
Signed-off-by: Md Haris Iqbal <haris.phnx@gmail.com>
---
ui/shader.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/ui/shader.c b/ui/shader.c
index 9264009..1ffddbe 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;
--
1.9.1
next reply other threads:[~2016-04-05 13:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-05 13:21 Md Haris Iqbal [this message]
2016-05-03 9:46 ` [Qemu-devel] [PATCH v1] Changed malloc to g_malloc, free to g_free in ui/shader.c haris iqbal
2016-05-03 10:12 ` Gerd Hoffmann
2016-05-03 15:21 ` haris iqbal
2016-05-11 11:34 ` Gerd Hoffmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1459862499-4768-1-git-send-email-haris.phnx@gmail.com \
--to=haris.phnx@gmail.com \
--cc=kraxel@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).