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:06:58 +0000 (15:06 -0700)
commit5174eed79343346e7e39cf47d1cb18e6caa76c54
tree7c5ccc694c2b167e0ca16057a6d04f3b4b9e364b
parent8c1c18769ef4838b11065b353f6f62bfd1de1cd2
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
(cherry picked from commit f93cb0bebb10e3e3e5df099be51021b211650356)
src/mesa/drivers/dri/common/dri_util.c