test_gesture_layer2: add null checking after memory allocation 62/143262/2
authorJaeun Choi <jaeun12.choi@samsung.com>
Wed, 9 Aug 2017 07:43:27 +0000 (16:43 +0900)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Fri, 11 Aug 2017 01:43:02 +0000 (01:43 +0000)
Change-Id: Ic733f8e173d1a0ca4c90479961b05fb27f8b3b4b
origin: upstream (530455fcee4767ce17ba56200b13dc688b64857a)

src/bin/test_gesture_layer2.c

index f74912a1e52bbb6d6cc0270c74c89ea21cc279cc..737cf159406cd41d18a4a5e95199c70e7893c12c 100644 (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;