diff mbox

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

Message ID 1459862499-4768-1-git-send-email-haris.phnx@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Md Haris Iqbal April 5, 2016, 1:21 p.m. UTC
Signed-off-by: Md Haris Iqbal <haris.phnx@gmail.com>
---
 ui/shader.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Md Haris Iqbal May 3, 2016, 9:46 a.m. UTC | #1
Just a reminder. waiting for a review for the previous patch.

On Tue, Apr 5, 2016 at 6:51 PM, Md Haris Iqbal <haris.phnx@gmail.com> wrote:
> 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
>
Gerd Hoffmann May 3, 2016, 10:12 a.m. UTC | #2
On Di, 2016-05-03 at 15:16 +0530, haris iqbal wrote:
> 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
Md Haris Iqbal May 3, 2016, 3:21 p.m. UTC | #3
On Tue, May 3, 2016 at 3:42 PM, Gerd Hoffmann <kraxel@redhat.com> wrote:
> On Di, 2016-05-03 at 15:16 +0530, haris iqbal wrote:
>> 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. :)
Gerd Hoffmann May 11, 2016, 11:34 a.m. UTC | #4
On Di, 2016-04-05 at 18:51 +0530, Md Haris Iqbal wrote:
> Signed-off-by: Md Haris Iqbal <haris.phnx@gmail.com>

Picked up for next ui pull request.

thanks,
  Gerd
diff mbox

Patch

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;