diff options
author | Jihoon Kim <jihoon48.kim@samsung.com> | 2017-08-01 10:27:37 +0900 |
---|---|---|
committer | Jihoon Kim <jihoon48.kim@samsung.com> | 2017-08-01 10:27:37 +0900 |
commit | 15250fb8cf63728d9b9ae073b7ae5085526c61ca (patch) | |
tree | 035eb4449f3060987fea7d5e664e1287107de158 | |
parent | acc76cadd3b10e882d3bb1b82fb96ee58fce2b71 (diff) |
ecore_imf: check return value of memory allocation
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
-rw-r--r-- | src/lib/ecore_imf/ecore_imf_context.c | 10 | ||||
-rw-r--r-- | src/lib/ecore_imf/ecore_imf_module.c | 2 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/lib/ecore_imf/ecore_imf_context.c b/src/lib/ecore_imf/ecore_imf_context.c index 2ac7d59e7f..caa2d59f1b 100644 --- a/src/lib/ecore_imf/ecore_imf_context.c +++ b/src/lib/ecore_imf/ecore_imf_context.c | |||
@@ -649,6 +649,8 @@ ecore_imf_context_preedit_start_event_add(Ecore_IMF_Context *ctx) | |||
649 | } | 649 | } |
650 | 650 | ||
651 | ev = malloc(sizeof(Ecore_IMF_Event_Preedit_Start)); | 651 | ev = malloc(sizeof(Ecore_IMF_Event_Preedit_Start)); |
652 | EINA_SAFETY_ON_NULL_RETURN(ev); | ||
653 | |||
652 | ev->ctx = ctx; | 654 | ev->ctx = ctx; |
653 | ecore_event_add(ECORE_IMF_EVENT_PREEDIT_START, | 655 | ecore_event_add(ECORE_IMF_EVENT_PREEDIT_START, |
654 | ev, _ecore_imf_event_free_preedit, NULL); | 656 | ev, _ecore_imf_event_free_preedit, NULL); |
@@ -667,6 +669,8 @@ ecore_imf_context_preedit_end_event_add(Ecore_IMF_Context *ctx) | |||
667 | } | 669 | } |
668 | 670 | ||
669 | ev = malloc(sizeof(Ecore_IMF_Event_Preedit_End)); | 671 | ev = malloc(sizeof(Ecore_IMF_Event_Preedit_End)); |
672 | EINA_SAFETY_ON_NULL_RETURN(ev); | ||
673 | |||
670 | ev->ctx = ctx; | 674 | ev->ctx = ctx; |
671 | ecore_event_add(ECORE_IMF_EVENT_PREEDIT_END, | 675 | ecore_event_add(ECORE_IMF_EVENT_PREEDIT_END, |
672 | ev, _ecore_imf_event_free_preedit, NULL); | 676 | ev, _ecore_imf_event_free_preedit, NULL); |
@@ -685,6 +689,8 @@ ecore_imf_context_preedit_changed_event_add(Ecore_IMF_Context *ctx) | |||
685 | } | 689 | } |
686 | 690 | ||
687 | ev = malloc(sizeof(Ecore_IMF_Event_Preedit_Changed)); | 691 | ev = malloc(sizeof(Ecore_IMF_Event_Preedit_Changed)); |
692 | EINA_SAFETY_ON_NULL_RETURN(ev); | ||
693 | |||
688 | ev->ctx = ctx; | 694 | ev->ctx = ctx; |
689 | ecore_event_add(ECORE_IMF_EVENT_PREEDIT_CHANGED, | 695 | ecore_event_add(ECORE_IMF_EVENT_PREEDIT_CHANGED, |
690 | ev, _ecore_imf_event_free_preedit, NULL); | 696 | ev, _ecore_imf_event_free_preedit, NULL); |
@@ -713,6 +719,8 @@ ecore_imf_context_commit_event_add(Ecore_IMF_Context *ctx, const char *str) | |||
713 | } | 719 | } |
714 | 720 | ||
715 | ev = malloc(sizeof(Ecore_IMF_Event_Commit)); | 721 | ev = malloc(sizeof(Ecore_IMF_Event_Commit)); |
722 | EINA_SAFETY_ON_NULL_RETURN(ev); | ||
723 | |||
716 | ev->ctx = ctx; | 724 | ev->ctx = ctx; |
717 | ev->str = str ? strdup(str) : NULL; | 725 | ev->str = str ? strdup(str) : NULL; |
718 | ecore_event_add(ECORE_IMF_EVENT_COMMIT, | 726 | ecore_event_add(ECORE_IMF_EVENT_COMMIT, |
@@ -1436,4 +1444,4 @@ ecore_imf_context_mime_type_accept_set(Ecore_IMF_Context *ctx, const char *mime_ | |||
1436 | 1444 | ||
1437 | if (ctx->klass->mime_type_accept_set) | 1445 | if (ctx->klass->mime_type_accept_set) |
1438 | ctx->klass->mime_type_accept_set(ctx, mime_type); | 1446 | ctx->klass->mime_type_accept_set(ctx, mime_type); |
1439 | } \ No newline at end of file | 1447 | } |
diff --git a/src/lib/ecore_imf/ecore_imf_module.c b/src/lib/ecore_imf/ecore_imf_module.c index 3fec5de1d6..814152f79b 100644 --- a/src/lib/ecore_imf/ecore_imf_module.c +++ b/src/lib/ecore_imf/ecore_imf_module.c | |||
@@ -306,6 +306,8 @@ ecore_imf_module_register(const Ecore_IMF_Context_Info *info, | |||
306 | modules = eina_hash_string_superfast_new(EINA_FREE_CB(_ecore_imf_module_free)); | 306 | modules = eina_hash_string_superfast_new(EINA_FREE_CB(_ecore_imf_module_free)); |
307 | 307 | ||
308 | module = malloc(sizeof(Ecore_IMF_Module)); | 308 | module = malloc(sizeof(Ecore_IMF_Module)); |
309 | EINA_SAFETY_ON_NULL_RETURN(module); | ||
310 | |||
309 | module->info = info; | 311 | module->info = info; |
310 | /* cache imf_module_create as it may be used several times */ | 312 | /* cache imf_module_create as it may be used several times */ |
311 | module->create = imf_module_create; | 313 | module->create = imf_module_create; |