r600g: fix error path and use util_slab_free
authorJerome Glisse <jglisse@redhat.com>
Mon, 5 Dec 2011 23:42:38 +0000 (18:42 -0500)
committerJerome Glisse <jglisse@redhat.com>
Mon, 5 Dec 2011 23:42:38 +0000 (18:42 -0500)
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
src/gallium/drivers/r600/r600_buffer.c

index f1b69565fd5e7b50ef95391b10b0fd5810337b34..f4388867a92ddf56c63a874755f9fdf072dfd5b6 100644 (file)
@@ -177,7 +177,7 @@ struct pipe_resource *r600_buffer_create(struct pipe_screen *screen,
        rbuffer->b.user_ptr = NULL;
 
        if (!r600_init_resource(rscreen, rbuffer, templ->width0, alignment, templ->bind, templ->usage)) {
-               FREE(rbuffer);
+               util_slab_free(&rscreen->pool_buffers, rbuffer);
                return NULL;
        }
        return &rbuffer->b.b.b;