summaryrefslogtreecommitdiff
path: root/hw/dmx/glxProxy/glxscreens.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/dmx/glxProxy/glxscreens.c')
-rw-r--r--hw/dmx/glxProxy/glxscreens.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/hw/dmx/glxProxy/glxscreens.c b/hw/dmx/glxProxy/glxscreens.c
index 15bb1e862..508e67ed4 100644
--- a/hw/dmx/glxProxy/glxscreens.c
+++ b/hw/dmx/glxProxy/glxscreens.c
@@ -129,7 +129,7 @@ CalcServerVersionAndExtensions(void)
/*
* read extensions strings of all back-end servers
*/
- be_extensions = (char **) malloc(__glXNumActiveScreens * sizeof(char *));
+ be_extensions = xallocarray(__glXNumActiveScreens, sizeof(char *));
if (!be_extensions)
return;
@@ -237,10 +237,9 @@ __glXScreenInit(GLint numscreens)
// find the set of FBConfigs that are present on all back-end
// servers - only those configs will be supported
*/
- __glXFBConfigs = (__GLXFBConfig **) malloc(dmxScreen0->numFBConfigs *
- (numscreens +
- 1) *
- sizeof(__GLXFBConfig *));
+ __glXFBConfigs =
+ xallocarray(dmxScreen0->numFBConfigs * (numscreens + 1),
+ sizeof(__GLXFBConfig *));
__glXNumFBConfigs = 0;
for (c = 0; c < dmxScreen0->numFBConfigs; c++) {