From 63fd426b4b4751810895b5343e8aaa36f92e2a98 Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Thu, 12 Aug 2010 10:43:22 +0100 Subject: [PATCH] cogl-shader: get_info_log should always use strdup In the case where there is no error log for arbfp we were returning a "" string literal. The other paths were using g_strdup to return a string that could be freed with g_free. This makes the arbfp path return g_strdup ("") instead. --- cogl/cogl-shader.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cogl/cogl-shader.c b/cogl/cogl-shader.c index a08bff57e..467bcb9b3 100644 --- a/cogl/cogl-shader.c +++ b/cogl/cogl-shader.c @@ -195,14 +195,16 @@ cogl_shader_get_info_log (CoglHandle handle) shader = _cogl_shader_pointer_from_handle (handle); +#ifdef HAVE_COGL_GL if (shader->language == COGL_SHADER_LANGUAGE_ARBFP) { /* ARBfp exposes a program error string, but since cogl_program * doesn't have any API to query an error log it is not currently * exposed. */ - return ""; + return g_strdup (""); } else +#endif { char buffer[512]; int len = 0;