From 2c8b55b351c84cda4e620a5aba3e67c110890567 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 22 Jan 2009 21:35:58 +1000 Subject: [PATCH] radeon: fix relocs even more --- src/mesa/drivers/dri/radeon/radeon_cs_legacy.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/mesa/drivers/dri/radeon/radeon_cs_legacy.c b/src/mesa/drivers/dri/radeon/radeon_cs_legacy.c index ef59dd1f5c8..f09031e83bb 100644 --- a/src/mesa/drivers/dri/radeon/radeon_cs_legacy.c +++ b/src/mesa/drivers/dri/radeon/radeon_cs_legacy.c @@ -335,11 +335,15 @@ static int cs_emit(struct radeon_cs *cs) return 0; } +static void inline cs_free_reloc(void *relocs_p) +{ + struct cs_reloc_legacy *relocs = relocs_p; + free(relocs->indices); +} + static int cs_destroy(struct radeon_cs *cs) { - struct cs_reloc_legacy *relocs; - relocs = cs->relocs; - free(relocs->indices); + cs_free_reloc(cs->relocs); free(cs->relocs); free(cs->packets); free(cs); @@ -348,6 +352,7 @@ static int cs_destroy(struct radeon_cs *cs) static int cs_erase(struct radeon_cs *cs) { + cs_free_reloc(cs->relocs); free(cs->relocs); cs->relocs_total_size = 0; cs->relocs = NULL; -- 2.30.2