Skip to contentSkip to conversation

Changed malloc to g_malloc, free to g_free in ui/shader.c

PATCH In review Md Haris Iqbal 2 participants 5 messages Apr 5, 2016 – May 11, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Changed malloc to g_malloc, free to g_free in ui/shader.c

---
 ui/shader.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
ui/shader.c +4 -4
index 9264009..1ffddbe 100644
@@ -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;
Signature · 1 line
1.9.1
#1 lore raw

Just a reminder. waiting for a review for the previous patch.

Quoted 40 lines · Md Haris Iqbal
---
 ui/shader.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
ui/shader.c +4 -5
index 9264009..1ffddbe 100644
@@ -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

Signature · 6 lines
With regards,

Md Haris Iqbal,
Placement Coordinator, MTech IT
NITK Surathkal,
Contact: +91 8861996962
#2 lore raw
Quoted 1 line · haris iqbal

Just a reminder. waiting for a review for the previous patch.

Patch is fine. Just stalled b/c we are in code freeze, I expect trivial queue will pick this up for the 2.7 devel cycle.

cheers,
Gerd

#3 lore raw
Quoted 9 lines · Gerd Hoffmann
Quoted 1 line · haris iqbal

Just a reminder. waiting for a review for the previous patch.

Patch is fine. Just stalled b/c we are in code freeze, I expect trivial queue will pick this up for the 2.7 devel cycle.

cheers,
Gerd

Thanks for the fast response. :)

Signature · 22 lines
With regards,

Md Haris Iqbal,
Placement Coordinator, MTech IT
NITK Surathkal,
Contact: +91 8861996962<div id="DDB4FAA8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br />
<table style="border-top: 1px solid #aaabb6;">
	<tr>
        <td style="width: 55px; padding-top: 13px;"><a
href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail"
target="_blank"><img
src="https://ipmcdn.avast.com/images/2016/icons/icon-envelope-tick-round-orange-v1.png"
/></a></td>
		<td style="width: 470px; padding-top: 15px; color: #41424e;
font-size: 13px; font-family: Arial, Helvetica, sans-serif;
line-height: 18px;">Virus-free. <a
href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail"
target="_blank" style="color: #4453ea;">www.avast.com</a>
		</td>
	</tr>
</table><a href="#DDB4FAA8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1"
height="1"></a></div>