summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/draw/draw_pipe_offset.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_pipe_offset.c')
-rw-r--r--src/gallium/auxiliary/draw/draw_pipe_offset.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pipe_offset.c b/src/gallium/auxiliary/draw/draw_pipe_offset.c
index c1dc21cd32..ffec85ccdd 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_offset.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_offset.c
@@ -158,6 +158,8 @@ static void offset_destroy( struct draw_stage *stage )
struct draw_stage *draw_offset_stage( struct draw_context *draw )
{
struct offset_stage *offset = CALLOC_STRUCT(offset_stage);
+ if (offset == NULL)
+ goto fail;
draw_alloc_temp_verts( &offset->stage, 3 );
@@ -171,4 +173,10 @@ struct draw_stage *draw_offset_stage( struct draw_context *draw )
offset->stage.destroy = offset_destroy;
return &offset->stage;
+
+ fail:
+ if (offset)
+ offset->stage.destroy( &offset->stage );
+
+ return NULL;
}