summaryrefslogtreecommitdiff
path: root/src/bin/elementary/test_ui_pager_scroll.c
diff options
context:
space:
mode:
authorJaeun Choi <jaeun12.choi@samsung.com>2019-02-14 16:08:33 +0900
committerJaeun Choi <jaeun12.choi@samsung.com>2019-02-14 16:10:15 +0900
commite39c71085801ca5cb73ff74815a4a203acd268d6 (patch)
tree2c784207f552af798bfe099b48348d9a240e9a16 /src/bin/elementary/test_ui_pager_scroll.c
parentdea75d0f3283f31751e577925e81758836c10b70 (diff)
test/efl_ui_pager: add NULL checking after calloc() function
Diffstat (limited to 'src/bin/elementary/test_ui_pager_scroll.c')
-rw-r--r--src/bin/elementary/test_ui_pager_scroll.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/bin/elementary/test_ui_pager_scroll.c b/src/bin/elementary/test_ui_pager_scroll.c
index b336f11..99a6fc9 100644
--- a/src/bin/elementary/test_ui_pager_scroll.c
+++ b/src/bin/elementary/test_ui_pager_scroll.c
@@ -417,6 +417,8 @@ static void page_size_cb(void *data,
417 efl_pack_end(inbox, efl_added)); 417 efl_pack_end(inbox, efl_added));
418 418
419 size_params = calloc(1, sizeof(Size_Params)); 419 size_params = calloc(1, sizeof(Size_Params));
420 if (!size_params) return;
421
420 size_params->slider = sl; 422 size_params->slider = sl;
421 size_params->pager = params->pager; 423 size_params->pager = params->pager;
422 size_params->params = params; 424 size_params->params = params;
@@ -456,6 +458,8 @@ static void page_size_cb(void *data,
456 efl_pack_end(inbox, efl_added)); 458 efl_pack_end(inbox, efl_added));
457 459
458 size_params = calloc(1, sizeof(Size_Params)); 460 size_params = calloc(1, sizeof(Size_Params));
461 if (!size_params) return;
462
459 size_params->slider = sl; 463 size_params->slider = sl;
460 size_params->pager = params->pager; 464 size_params->pager = params->pager;
461 size_params->params = params; 465 size_params->params = params;
@@ -570,6 +574,8 @@ static void pack_cb(void *data,
570 574
571 // Pack Begin 575 // Pack Begin
572 pack_param = calloc(1, sizeof(Pack_Params)); 576 pack_param = calloc(1, sizeof(Pack_Params));
577 if (!pack_param) return;
578
573 pack_param->pager = pager; 579 pack_param->pager = pager;
574 pack_param->pack_sp = sp1; 580 pack_param->pack_sp = sp1;
575 pack_param->unpack_sp = sp2; 581 pack_param->unpack_sp = sp2;
@@ -586,6 +592,8 @@ static void pack_cb(void *data,
586 592
587 // Pack End 593 // Pack End
588 pack_param = calloc(1, sizeof(Pack_Params)); 594 pack_param = calloc(1, sizeof(Pack_Params));
595 if (!pack_param) return;
596
589 pack_param->pager = pager; 597 pack_param->pager = pager;
590 pack_param->pack_sp = sp1; 598 pack_param->pack_sp = sp1;
591 pack_param->unpack_sp = sp2; 599 pack_param->unpack_sp = sp2;
@@ -602,6 +610,8 @@ static void pack_cb(void *data,
602 610
603 // Pack Before 611 // Pack Before
604 pack_param = calloc(1, sizeof(Pack_Params)); 612 pack_param = calloc(1, sizeof(Pack_Params));
613 if (!pack_param) return;
614
605 pack_param->pager = pager; 615 pack_param->pager = pager;
606 pack_param->pack_sp = sp1; 616 pack_param->pack_sp = sp1;
607 pack_param->unpack_sp = sp2; 617 pack_param->unpack_sp = sp2;
@@ -618,6 +628,8 @@ static void pack_cb(void *data,
618 628
619 // Pack After 629 // Pack After
620 pack_param = calloc(1, sizeof(Pack_Params)); 630 pack_param = calloc(1, sizeof(Pack_Params));
631 if (!pack_param) return;
632
621 pack_param->pager = pager; 633 pack_param->pager = pager;
622 pack_param->pack_sp = sp1; 634 pack_param->pack_sp = sp1;
623 pack_param->unpack_sp = sp2; 635 pack_param->unpack_sp = sp2;
@@ -634,6 +646,8 @@ static void pack_cb(void *data,
634 646
635 // Pack At 647 // Pack At
636 pack_param = calloc(1, sizeof(Pack_Params)); 648 pack_param = calloc(1, sizeof(Pack_Params));
649 if (!pack_param) return;
650
637 pack_param->pager = pager; 651 pack_param->pager = pager;
638 pack_param->pack_sp = sp1; 652 pack_param->pack_sp = sp1;
639 pack_param->unpack_sp = sp2; 653 pack_param->unpack_sp = sp2;
@@ -653,6 +667,8 @@ static void pack_cb(void *data,
653 667
654 // Unpack At 668 // Unpack At
655 pack_param = calloc(1, sizeof(Pack_Params)); 669 pack_param = calloc(1, sizeof(Pack_Params));
670 if (!pack_param) return;
671
656 pack_param->pager = pager; 672 pack_param->pager = pager;
657 pack_param->pack_sp = sp1; 673 pack_param->pack_sp = sp1;
658 pack_param->unpack_sp = sp2; 674 pack_param->unpack_sp = sp2;
@@ -691,6 +707,7 @@ static void current_page_cb(void *data,
691 Eo *pager = params->pager; 707 Eo *pager = params->pager;
692 Eo *btn, *box, *sp; 708 Eo *btn, *box, *sp;
693 Page_Set_Params *psp = calloc(1, sizeof(Page_Set_Params)); 709 Page_Set_Params *psp = calloc(1, sizeof(Page_Set_Params));
710 if (!psp) return;
694 711
695 btn = efl_add(EFL_UI_BUTTON_CLASS, navi, 712 btn = efl_add(EFL_UI_BUTTON_CLASS, navi,
696 efl_text_set(efl_added, "Back"), 713 efl_text_set(efl_added, "Back"),
@@ -884,6 +901,8 @@ void test_ui_pager_scroll(void *data EINA_UNUSED,
884 efl_ui_pager_transition_set(pager, efl_added)); 901 efl_ui_pager_transition_set(pager, efl_added));
885 902
886 params = calloc(1, sizeof(Params)); 903 params = calloc(1, sizeof(Params));
904 if (!params) return;
905
887 params->navi = navi; 906 params->navi = navi;
888 params->pager = pager; 907 params->pager = pager;
889 params->transition = NULL; 908 params->transition = NULL;