mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-06-07 06:28:19 +02:00
glamor: free the link log on shader link failure
glamor_link_glsl_prog() retrieves the GL link log when program linking
fails and prints it with ErrorF(), but did not free the allocated log.
Direct leak of 51 byte(s) in 1 object(s) allocated from:
#0 in malloc
#1 in glamor_link_glsl_prog ../glamor/glamor_core.c:105
#2 in _glamor_create_linear_gradient_program ../glamor/glamor_gradient.c:541
#3 in glamor_init_gradient_shader ../glamor/glamor_gradient.c:577
#4 in glamor_init ../glamor/glamor.c:870
#5 in xwl_glamor_init ../hw/xwayland/xwayland-glamor.c:247
#6 in xwl_screen_init ../hw/xwayland/xwayland-screen.c:1121
...
This commit is contained in:
parent
b192c66e05
commit
3d85c04df0
1 changed files with 3 additions and 0 deletions
|
|
@ -103,9 +103,12 @@ glamor_link_glsl_prog(ScreenPtr screen, GLint prog, const char *format, ...)
|
|||
|
||||
glGetProgramiv(prog, GL_INFO_LOG_LENGTH, &size);
|
||||
info = malloc(size);
|
||||
if (!info)
|
||||
return FALSE;
|
||||
|
||||
glGetProgramInfoLog(prog, size, NULL, info);
|
||||
ErrorF("Failed to link: %s\n", info);
|
||||
free(info);
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue