summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKim Woelders <kim@woelders.dk>2008-10-17 16:53:29 -0400
committerAdam Jackson <ajax@redhat.com>2008-10-17 16:53:29 -0400
commitf467d17ae5a89aa1a2b8c7260334f41e8ee2d08c (patch)
tree33b27c29d67e3915a78e1213a0fb643e8a69b2fc
parent49563f5d76637e2ca28fe0b91ce3114271c0955d (diff)
Bug #17774: Allocate the right size in XSyncListSystemCounters.
-rw-r--r--src/XSync.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/XSync.c b/src/XSync.c
index 61f8600..9f266a5 100644
--- a/src/XSync.c
+++ b/src/XSync.c
@@ -1,4 +1,3 @@
-/* $Xorg: XSync.c,v 1.5 2001/02/09 02:03:49 xorgcvs Exp $ */
/*
Copyright 1991, 1993, 1998 The Open Group
@@ -287,11 +286,10 @@ XSyncListSystemCounters(Display *dpy, int *n_counters_return)
int replylen;
int i;
- list = (XSyncSystemCounter *)Xmalloc(
- rep.nCounters * sizeof(XSyncSystemCounter));
+ list = Xmalloc(rep.nCounters * sizeof(XSyncSystemCounter));
replylen = rep.length << 2;
- pWireSysCounter = (xSyncSystemCounter *) Xmalloc ((unsigned) replylen + 1);
- /* +1 to leave room for last null-terminator */
+ pWireSysCounter = Xmalloc ((unsigned) replylen + sizeof(XSyncCounter));
+ /* +1 to leave room for last counter read-ahead */
if ((!list) || (!pWireSysCounter))
{