dri_util: Use calloc to allocate __DRIcontext
authorIan Romanick <ian.d.romanick@intel.com>
Wed, 26 Sep 2012 18:08:11 +0000 (11:08 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Fri, 28 Sep 2012 22:05:24 +0000 (15:05 -0700)
commitf93cb0bebb10e3e3e5df099be51021b211650356
tree11503f91f459119b01da6c796c1427155fa86427
parent4c704e5949ced0cfaa710e492843890d57956199
dri_util: Use calloc to allocate __DRIcontext

The __DRIcontext contains some pointers, and some drivers check for them to be
NULL in some failure paths.  Instead of sprinkling NULL assignments across the
various drivers, just zero out the whole thing.

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Lu Hua <huax.lu@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53618
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54301
src/mesa/drivers/dri/common/dri_util.c