glsl: Fix NULL pointer dereferences when linking fails.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 2 Aug 2013 07:35:05 +0000 (00:35 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Fri, 2 Aug 2013 15:24:23 +0000 (08:24 -0700)
commit7d2423a09ec8a40b7da7c90fe3cb863d03f96b39
treefc8efcaccb3e1f98ce050bddaf0406c8b28e20a9
parent9d569fed8dec675446d37ff9d8b16554b18e542e
glsl: Fix NULL pointer dereferences when linking fails.

Commit 7cfefe6965d50 introduced a check for whether linked->Type equals
GL_GEOMETRY_SHADER.  However, linked may be NULL due to an earlier error
condition.

Since the entire function after the error path is (or should be) guarded
by linked != NULL checks, we may as well just return early and remove
the checks.

Fixes crashes in 9 Piglit tests.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
src/glsl/linker.cpp