From: Dave Airlie Date: Thu, 22 Jan 2009 11:38:35 +0000 (+1000) Subject: radeon: check relocs before deref X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=02952a41eb0e47ab77a984922c1c3202aeb45b50;p=mesa.git radeon: check relocs before deref --- 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)