diff options
author | Keith Whitwell <keith@tungstengraphics.com> | 2008-04-21 17:03:37 +0100 |
---|---|---|
committer | Keith Whitwell <keith@tungstengraphics.com> | 2008-04-21 17:03:37 +0100 |
commit | 0d4ece4c5a243dc4b684331bad49f220311e5520 (patch) | |
tree | 8678f1241e5b47a6603da13b25a5844c92b8986c /src/gallium/auxiliary/draw/draw_pipe_twoside.c | |
parent | 0cd90a917d289363a3edb5cfa40c391eb07aa97c (diff) |
draw: propogate lots of errors
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_pipe_twoside.c')
-rw-r--r-- | src/gallium/auxiliary/draw/draw_pipe_twoside.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pipe_twoside.c b/src/gallium/auxiliary/draw/draw_pipe_twoside.c index 453fd3ac71..5910dccc43 100644 --- a/src/gallium/auxiliary/draw/draw_pipe_twoside.c +++ b/src/gallium/auxiliary/draw/draw_pipe_twoside.c @@ -172,8 +172,11 @@ static void twoside_destroy( struct draw_stage *stage ) struct draw_stage *draw_twoside_stage( struct draw_context *draw ) { struct twoside_stage *twoside = CALLOC_STRUCT(twoside_stage); + if (twoside == NULL) + goto fail; - draw_alloc_temp_verts( &twoside->stage, 3 ); + if (!draw_alloc_temp_verts( &twoside->stage, 3 )) + goto fail; twoside->stage.draw = draw; twoside->stage.next = NULL; @@ -185,4 +188,10 @@ struct draw_stage *draw_twoside_stage( struct draw_context *draw ) twoside->stage.destroy = twoside_destroy; return &twoside->stage; + + fail: + if (twoside) + twoside->stage.destroy( &twoside->stage ); + + return NULL; } |