summaryrefslogtreecommitdiff
path: root/src/Xdbe.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2022-06-10 16:21:59 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2022-06-10 16:21:59 -0700
commite6ff50b4634f2f2211997444a73d35277a0608d4 (patch)
treeed114d5f18eeb7c031445908a4261285bd2fd369 /src/Xdbe.c
parentbba869e4ff5826d48ea409b4a8bf4ff7ad414453 (diff)
downloadxorg-lib-libXext-e6ff50b4634f2f2211997444a73d35277a0608d4.tar.gz
Use calloc instead of malloc if we may not initialize all the bytes
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'src/Xdbe.c')
-rw-r--r--src/Xdbe.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Xdbe.c b/src/Xdbe.c
index 5c27a01..514f078 100644
--- a/src/Xdbe.c
+++ b/src/Xdbe.c
@@ -348,7 +348,7 @@ XdbeScreenVisualInfo *XdbeGetVisualInfo (
/* allocate list of visual information to be returned */
if ((*num_screens > 0) && (*num_screens < 65536))
- scrVisInfo = Xmalloc(*num_screens * sizeof(XdbeScreenVisualInfo));
+ scrVisInfo = Xcalloc(*num_screens, sizeof(XdbeScreenVisualInfo));
else
scrVisInfo = NULL;
if (scrVisInfo == NULL) {