summaryrefslogtreecommitdiff
path: root/ism
diff options
context:
space:
mode:
authorJihoon Kim <jihoon48.kim@samsung.com>2020-05-15 11:24:58 +0900
committerJihoon Kim <jihoon48.kim@samsung.com>2020-05-15 11:24:58 +0900
commitebd4daade7903f6d19b045dbd54b488eefe8c0dc (patch)
tree0bdf3023767edc19fca51324af45399d99eb17a7 /ism
parent798c656f9e8706c937388b53243e945e28b8a07d (diff)
downloadisf-ebd4daade7903f6d19b045dbd54b488eefe8c0dc.tar.gz
isf-ebd4daade7903f6d19b045dbd54b488eefe8c0dc.tar.bz2
isf-ebd4daade7903f6d19b045dbd54b488eefe8c0dc.zip
Fix memory leak in case of setting mime type multiple times
Change-Id: If5633673132f3ba6ec39a5005ce14b8be068d989 Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
Diffstat (limited to 'ism')
-rw-r--r--ism/extras/wayland_immodule/wayland_imcontext.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ism/extras/wayland_immodule/wayland_imcontext.c b/ism/extras/wayland_immodule/wayland_imcontext.c
index 5cbc4992..ae1cb8db 100644
--- a/ism/extras/wayland_immodule/wayland_imcontext.c
+++ b/ism/extras/wayland_immodule/wayland_imcontext.c
@@ -3884,6 +3884,9 @@ wayland_im_context_mime_type_accept_set (Ecore_IMF_Context *ctx, const char *mim
WaylandIMContext *imcontext = (WaylandIMContext *)ecore_imf_context_data_get(ctx);
if (!imcontext) return;
+ if (imcontext->mime_type)
+ free(imcontext->mime_type);
+
imcontext->mime_type = strdup(mime_type);
if (imcontext->input && imcontext->text_input && (strlen(mime_type) > 0)) {