mesa: glsl: added null ptr check
authorBrian Paul <brian.paul@tungstengraphics.com>
Tue, 29 Jul 2008 23:27:44 +0000 (17:27 -0600)
committerBrian Paul <brian.paul@tungstengraphics.com>
Tue, 29 Jul 2008 23:27:44 +0000 (17:27 -0600)
src/mesa/shader/slang/slang_compile_struct.c

index 96bdb1f49106e969960d4cc1a7828ed108da2b4d..063db37709b5707393b584230e707332186a5d84 100644 (file)
@@ -124,7 +124,8 @@ slang_struct_destruct(slang_struct * stru)
 {
    slang_variable_scope_destruct(stru->fields);
    _slang_free(stru->fields);
-   slang_struct_scope_destruct(stru->structs);
+   if (stru->structs)
+      slang_struct_scope_destruct(stru->structs);
    _slang_free(stru->structs);
 }