glsl/test: Fix use after free in test_optpass.
authorHanno Böck <hanno@hboeck.de>
Wed, 7 Nov 2018 08:01:42 +0000 (09:01 +0100)
committerTapani Pälli <tapani.palli@intel.com>
Mon, 12 Nov 2018 05:42:58 +0000 (07:42 +0200)
commit8dc2085baf954e7d52159797fe3051a554df3f6d
tree9d45268ab534d59e59aa8d3446abc09650ca358c
parenta068958692cc662203f04e488356005533568a56
glsl/test: Fix use after free in test_optpass.

The variable state is free'd and afterwards state->error is used
as the return value, resulting in a use after free bug detected
by memory safety tools like address sanitizer.

Signed-off-by: Hanno Böck <hanno@hboeck.de>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108636
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
src/compiler/glsl/test_optpass.cpp