From 02952a41eb0e47ab77a984922c1c3202aeb45b50 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 22 Jan 2009 21:38:35 +1000 Subject: radeon: check relocs before deref --- src/mesa/drivers/dri/radeon/radeon_cs_legacy.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/mesa/drivers/dri/radeon/radeon_cs_legacy.c') diff --git a/src/mesa/drivers/dri/radeon/radeon_cs_legacy.c b/src/mesa/drivers/dri/radeon/radeon_cs_legacy.c index f09031e83bb..b9751248280 100644 --- a/src/mesa/drivers/dri/radeon/radeon_cs_legacy.c +++ b/src/mesa/drivers/dri/radeon/radeon_cs_legacy.c @@ -337,8 +337,9 @@ static int cs_emit(struct radeon_cs *cs) static void inline cs_free_reloc(void *relocs_p) { - struct cs_reloc_legacy *relocs = relocs_p; - free(relocs->indices); + struct cs_reloc_legacy *relocs = relocs_p; + if (relocs) + free(relocs->indices); } static int cs_destroy(struct radeon_cs *cs) -- cgit v1.2.3