From: Dave Airlie Date: Thu, 22 Jan 2009 11:35:58 +0000 (+1000) Subject: radeon: fix relocs even more X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2c8b55b351c84cda4e620a5aba3e67c110890567;p=mesa.git radeon: fix relocs even more --- 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;