Fix memory leak in case of setting mime type multiple times 62/233462/1
authorJihoon Kim <jihoon48.kim@samsung.com>
Fri, 15 May 2020 02:24:58 +0000 (11:24 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Fri, 15 May 2020 02:29:05 +0000 (11:29 +0900)
Change-Id: If5633673132f3ba6ec39a5005ce14b8be068d989
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
ism/extras/wayland_immodule/wayland_imcontext.c

index bb7cbc0..c25d144 100644 (file)
@@ -3903,6 +3903,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)) {