diff --git a/Xext/sync.c b/Xext/sync.c index 8eec01ebb..61bd693e8 100644 --- a/Xext/sync.c +++ b/Xext/sync.c @@ -2620,9 +2620,11 @@ IdleTimeQueryValue(void *pCounter, int64_t *pValue_return) int deviceid; CARD32 idle; + *pValue_return = 0; if (pCounter) { SyncCounter *counter = pCounter; IdleCounterPriv *priv = SysCounterGetPrivate(counter); + BUG_RETURN(priv == NULL); deviceid = priv->deviceid; } else @@ -2636,6 +2638,7 @@ IdleTimeBlockHandler(void *pCounter, void *wt) { SyncCounter *counter = pCounter; IdleCounterPriv *priv = SysCounterGetPrivate(counter); + BUG_RETURN(priv == NULL); int64_t *less = priv->value_less; int64_t *greater = priv->value_greater; int64_t idle, old_idle; @@ -2726,6 +2729,7 @@ IdleTimeWakeupHandler(void *pCounter, int rc) { SyncCounter *counter = pCounter; IdleCounterPriv *priv = SysCounterGetPrivate(counter); + BUG_RETURN(priv == NULL); int64_t *less = priv->value_less; int64_t *greater = priv->value_greater; int64_t idle; @@ -2759,6 +2763,7 @@ IdleTimeBracketValues(void *pCounter, int64_t *pbracket_less, { SyncCounter *counter = pCounter; IdleCounterPriv *priv = SysCounterGetPrivate(counter); + BUG_RETURN(priv == NULL); int64_t *less = priv->value_less; int64_t *greater = priv->value_greater; Bool registered = (less || greater);