mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-05 11:12:42 +00:00
glamor: fix leak of fs_getcolor_source.
This is created using XNFstrdup, so it needs to be freed.
Pointed out by coverity.
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit f0a5c0d1fd)
This commit is contained in:
committed by
Olivier Fourdan
parent
bb384d0b11
commit
795c58a1fe
@@ -38,7 +38,7 @@
|
||||
#define RADIAL_SMALL_STOPS (6 + 2)
|
||||
#define RADIAL_LARGE_STOPS (16 + 2)
|
||||
|
||||
static const char *
|
||||
static char *
|
||||
_glamor_create_getcolor_fs_source(ScreenPtr screen, int stops_count,
|
||||
int use_array)
|
||||
{
|
||||
@@ -310,7 +310,7 @@ _glamor_create_radial_gradient_program(ScreenPtr screen, int stops_count,
|
||||
"}\n"\
|
||||
"\n"\
|
||||
"%s\n" /* fs_getcolor_source */
|
||||
const char *fs_getcolor_source;
|
||||
char *fs_getcolor_source;
|
||||
|
||||
glamor_priv = glamor_get_screen_private(screen);
|
||||
|
||||
@@ -343,6 +343,7 @@ _glamor_create_radial_gradient_program(ScreenPtr screen, int stops_count,
|
||||
fs_prog = glamor_compile_glsl_prog(GL_FRAGMENT_SHADER, gradient_fs);
|
||||
|
||||
free(gradient_fs);
|
||||
free(fs_getcolor_source);
|
||||
|
||||
glAttachShader(gradient_prog, vs_prog);
|
||||
glAttachShader(gradient_prog, fs_prog);
|
||||
@@ -493,7 +494,7 @@ _glamor_create_linear_gradient_program(ScreenPtr screen, int stops_count,
|
||||
"}\n"\
|
||||
"\n"\
|
||||
"%s" /* fs_getcolor_source */
|
||||
const char *fs_getcolor_source;
|
||||
char *fs_getcolor_source;
|
||||
|
||||
glamor_priv = glamor_get_screen_private(screen);
|
||||
|
||||
@@ -522,6 +523,7 @@ _glamor_create_linear_gradient_program(ScreenPtr screen, int stops_count,
|
||||
|
||||
fs_prog = glamor_compile_glsl_prog(GL_FRAGMENT_SHADER, gradient_fs);
|
||||
free(gradient_fs);
|
||||
free(fs_getcolor_source);
|
||||
|
||||
glAttachShader(gradient_prog, vs_prog);
|
||||
glAttachShader(gradient_prog, fs_prog);
|
||||
|
||||
Reference in New Issue
Block a user