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:
parent
6241b5e4fd
commit
b96275c4cd
|
@ -432,6 +432,9 @@ valuator_mask_new(int num_valuators)
|
||||||
* flying-car future, when we can dynamically alloc the masks and are
|
* flying-car future, when we can dynamically alloc the masks and are
|
||||||
* not constrained by signals, we can start using num_valuators */
|
* not constrained by signals, we can start using num_valuators */
|
||||||
ValuatorMask *mask = calloc(1, sizeof(ValuatorMask));
|
ValuatorMask *mask = calloc(1, sizeof(ValuatorMask));
|
||||||
|
if (mask == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
mask->last_bit = -1;
|
mask->last_bit = -1;
|
||||||
return mask;
|
return mask;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue