diff options
author | Keith Whitwell <[email protected]> | 2008-04-21 17:03:37 +0100 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2008-04-21 17:03:37 +0100 |
commit | 0d4ece4c5a243dc4b684331bad49f220311e5520 (patch) | |
tree | 8678f1241e5b47a6603da13b25a5844c92b8986c /src/gallium/auxiliary/draw/draw_pipe_flatshade.c | |
parent | 0cd90a917d289363a3edb5cfa40c391eb07aa97c (diff) |
draw: propogate lots of errors
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_pipe_flatshade.c')
-rw-r--r-- | src/gallium/auxiliary/draw/draw_pipe_flatshade.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pipe_flatshade.c b/src/gallium/auxiliary/draw/draw_pipe_flatshade.c index 2aeb3095544..205000cbea5 100644 --- a/src/gallium/auxiliary/draw/draw_pipe_flatshade.c +++ b/src/gallium/auxiliary/draw/draw_pipe_flatshade.c @@ -224,8 +224,11 @@ static void flatshade_destroy( struct draw_stage *stage ) struct draw_stage *draw_flatshade_stage( struct draw_context *draw ) { struct flat_stage *flatshade = CALLOC_STRUCT(flat_stage); + if (flatshade == NULL) + goto fail; - draw_alloc_temp_verts( &flatshade->stage, 2 ); + if (!draw_alloc_temp_verts( &flatshade->stage, 2 )) + goto fail; flatshade->stage.draw = draw; flatshade->stage.next = NULL; @@ -237,6 +240,12 @@ struct draw_stage *draw_flatshade_stage( struct draw_context *draw ) flatshade->stage.destroy = flatshade_destroy; return &flatshade->stage; + + fail: + if (flatshade) + flatshade->stage.destroy( &flatshade->stage ); + + return NULL; } |