mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 22:49:13 +02:00
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
This commit is contained in:
parent
4c704e5949
commit
f93cb0bebb
1 changed files with 1 additions and 1 deletions
|
|
@ -272,7 +272,7 @@ dri2CreateContextAttribs(__DRIscreen *screen, int api,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
context = malloc(sizeof *context);
|
||||
context = calloc(1, sizeof *context);
|
||||
if (!context) {
|
||||
*error = __DRI_CTX_ERROR_NO_MEMORY;
|
||||
return NULL;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue