Commit 5f90db5f authored by Julien Michel's avatar Julien Michel

COMP: Fixing coverity issue 1350185 (null pointer dereference)

parent 1ccc4e38
......@@ -71,6 +71,8 @@ void FragmentShaderRegistry::RegisterShader(const std::string& name, const std::
char * logs = new char[length];
glGetShaderInfoLog(shader,1000,&length,logs);
std::string slogs = logs;
delete [] logs;
// For safety!
logs = NULL;
......@@ -83,7 +85,7 @@ void FragmentShaderRegistry::RegisterShader(const std::string& name, const std::
glDeleteProgram( program );
program = 0;
itkExceptionMacro(<<"Shader "<<name<<" with sources "<<source<<" failed to compile: "<<logs);
itkExceptionMacro(<<"Shader "<<name<<" with sources "<<source<<" failed to compile: "<<slogs);
}
glAttachShader(program,shader);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment