dix: fix an out-of-memory crash

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Benjamin Otte 2012-02-07 18:01:25 +10:00 committed by Peter Hutterer
parent 6241b5e4fd
commit b96275c4cd

View File

@ -432,6 +432,9 @@ valuator_mask_new(int num_valuators)
* flying-car future, when we can dynamically alloc the masks and are
* not constrained by signals, we can start using num_valuators */
ValuatorMask *mask = calloc(1, sizeof(ValuatorMask));
if (mask == NULL)
return NULL;
mask->last_bit = -1;
return mask;
}