1
0
Fork 0

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.
This commit is contained in:
Robert Bragg 2010-08-12 10:43:22 +01:00
parent b50bdd7919
commit 01a7272599

View file

@ -195,14 +195,16 @@ cogl_shader_get_info_log (CoglHandle handle)
shader = _cogl_shader_pointer_from_handle (handle); shader = _cogl_shader_pointer_from_handle (handle);
#ifdef HAVE_COGL_GL
if (shader->language == COGL_SHADER_LANGUAGE_ARBFP) if (shader->language == COGL_SHADER_LANGUAGE_ARBFP)
{ {
/* ARBfp exposes a program error string, but since cogl_program /* ARBfp exposes a program error string, but since cogl_program
* doesn't have any API to query an error log it is not currently * doesn't have any API to query an error log it is not currently
* exposed. */ * exposed. */
return ""; return g_strdup ("");
} }
else else
#endif
{ {
char buffer[512]; char buffer[512];
int len = 0; int len = 0;