From e7dfb6c0869692307c85738d71f2f4fe08ef956b Mon Sep 17 00:00:00 2001 From: MinJeong Kim Date: Wed, 17 Aug 2016 17:50:27 +0900 Subject: [PATCH] elm_win: fix possible double free of option string Change-Id: I71ade15cd0705272679ca166fad4aefb540014ec Signed-off-by: MinJeong Kim --- src/lib/elm_win.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/lib/elm_win.c b/src/lib/elm_win.c index 4ea4b8b..4fefa53 100644 --- a/src/lib/elm_win.c +++ b/src/lib/elm_win.c @@ -2507,7 +2507,8 @@ _elm_win_wl_aux_message(void *data, int type EINA_UNUSED, void *event) ELM_WIN_DATA_GET(data, sd); Ecore_Wl_Event_Aux_Message *ev = event; Elm_Win_Aux_Message *msg = NULL; - char *opt = NULL; + const char *opt = NULL, *tmp = NULL; + Eina_List *l; if (!sd->wl.win) return ECORE_CALLBACK_PASS_ON; @@ -2519,7 +2520,13 @@ _elm_win_wl_aux_message(void *data, int type EINA_UNUSED, void *event) msg->key = eina_stringshare_add(ev->key); msg->val = eina_stringshare_add(ev->val); - msg->options = eina_list_clone(ev->options); + + EINA_LIST_FOREACH(ev->options, l, opt) + { + if (!opt) continue; + tmp = eina_stringshare_add(opt); + msg->options = eina_list_append(msg->options, tmp); + } evas_object_smart_callback_call(sd->obj, SIG_AUX_MESSAGE_RECEIVED, (void*)msg); -- 2.7.4