summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorInhong Han <inhong1.han@samsung.com>2018-10-16 18:26:16 +0900
committerInHong Han <inhong1.han@samsung.com>2018-10-17 09:42:51 +0000
commit41239dbf4e2f3c81de79a0d2650da8b247ae04bd (patch)
tree0be73cebe810c1e4a304732b5057dc12b74c3a81
parent4f45681e66908d4102c80c10a48513e567bdd378 (diff)
downloadisf-41239dbf4e2f3c81de79a0d2650da8b247ae04bd.tar.gz
isf-41239dbf4e2f3c81de79a0d2650da8b247ae04bd.tar.bz2
isf-41239dbf4e2f3c81de79a0d2650da8b247ae04bd.zip
Prevent Segmentation fault
Change-Id: Ic68d72896aa32c2573fa9c540571a813d66ade14 (cherry picked from commit cc321f17c4629729f9229af4ed40c4a5af9fd291)
-rw-r--r--ism/extras/wayland_immodule/wayland_imcontext.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/ism/extras/wayland_immodule/wayland_imcontext.c b/ism/extras/wayland_immodule/wayland_imcontext.c
index 4f50b28c..bde1b04f 100644
--- a/ism/extras/wayland_immodule/wayland_imcontext.c
+++ b/ism/extras/wayland_immodule/wayland_imcontext.c
@@ -1221,7 +1221,10 @@ check_serial(WaylandIMContext *imcontext, uint32_t serial)
imcontext->pending_preedit.cursor = 0;
if (imcontext->pending_preedit.attrs) {
- EINA_LIST_FREE(imcontext->pending_preedit.attrs, attr) free(attr);
+ EINA_LIST_FREE(imcontext->pending_preedit.attrs, attr) {
+ if (attr)
+ free(attr);
+ }
imcontext->pending_preedit.attrs = NULL;
}
@@ -1245,8 +1248,10 @@ clear_preedit_text(WaylandIMContext *imcontext)
}
if (imcontext->preedit_attrs) {
- EINA_LIST_FREE(imcontext->preedit_attrs, attr)
- free(attr);
+ EINA_LIST_FREE(imcontext->preedit_attrs, attr) {
+ if (attr)
+ free(attr);
+ }
}
imcontext->preedit_attrs = NULL;
@@ -2911,7 +2916,8 @@ wayland_im_context_del (Ecore_IMF_Context *ctx)
clear_preedit (imcontext);
EINA_LIST_FREE(imcontext->keysym_list, ev) {
- free(ev);
+ if (ev)
+ free(ev);
}
free(imcontext);