If gs is null, then freeing state->shader.tokens would result in a null
dereference.
Fixes "Dereference after null check" defect reported by Coverity.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
struct lp_geometry_shader *state =
(struct lp_geometry_shader *)gs;
- draw_delete_geometry_shader(llvmpipe->draw,
- (state) ? state->draw_data : 0);
+ if (!state) {
+ return;
+ }
+
+ draw_delete_geometry_shader(llvmpipe->draw, state->draw_data);
FREE( (void *)state->shader.tokens );
FREE(state);
}