test_gesture_layer2: add null checking after memory allocation

This commit is contained in:
Jaeun Choi 2017-08-09 16:07:15 +09:00
parent 6641c07262
commit 530455fcee
1 changed files with 2 additions and 0 deletions

View File

@ -82,6 +82,8 @@ infra_data *
_infra_data_alloc(void)
{
infra_data *infra = malloc(sizeof(infra_data));
if (!infra) return NULL;
infra->icons = calloc(N_GESTURE_TYPE, sizeof(icon_properties ));
infra->colortimer = NULL;