summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/draw/draw_pipe_wide_point.c
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2008-04-21 17:03:37 +0100
committerKeith Whitwell <keith@tungstengraphics.com>2008-04-21 17:03:37 +0100
commit0d4ece4c5a243dc4b684331bad49f220311e5520 (patch)
tree8678f1241e5b47a6603da13b25a5844c92b8986c /src/gallium/auxiliary/draw/draw_pipe_wide_point.c
parent0cd90a917d289363a3edb5cfa40c391eb07aa97c (diff)
draw: propogate lots of errors
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_pipe_wide_point.c')
-rw-r--r--src/gallium/auxiliary/draw/draw_pipe_wide_point.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pipe_wide_point.c b/src/gallium/auxiliary/draw/draw_pipe_wide_point.c
index 8101340680..ed08573382 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_wide_point.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_wide_point.c
@@ -249,8 +249,11 @@ static void widepoint_destroy( struct draw_stage *stage )
struct draw_stage *draw_wide_point_stage( struct draw_context *draw )
{
struct widepoint_stage *wide = CALLOC_STRUCT(widepoint_stage);
+ if (wide == NULL)
+ goto fail;
- draw_alloc_temp_verts( &wide->stage, 4 );
+ if (!draw_alloc_temp_verts( &wide->stage, 4 ))
+ goto fail;
wide->stage.draw = draw;
wide->stage.next = NULL;
@@ -262,4 +265,10 @@ struct draw_stage *draw_wide_point_stage( struct draw_context *draw )
wide->stage.destroy = widepoint_destroy;
return &wide->stage;
+
+ fail:
+ if (wide)
+ wide->stage.destroy( &wide->stage );
+
+ return NULL;
}