summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-05-17 15:13:10 +0900
committerStefan Schmidt <stefan@osg.samsung.com>2017-05-18 11:44:25 +0200
commitf2641d342f13b03616673dc1033ca9f18ce3936e (patch)
treec3e501a5827fec84b144f45a75ff79403759d0a7
parent29410430e86bd253b444535d6be2fcd2ff57a3a2 (diff)
elm_code: Fix use after free
-rw-r--r--src/lib/elementary/elm_code_widget.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/elementary/elm_code_widget.c b/src/lib/elementary/elm_code_widget.c
index 245be0ae8a..e19aa5500b 100644
--- a/src/lib/elementary/elm_code_widget.c
+++ b/src/lib/elementary/elm_code_widget.c
@@ -1374,11 +1374,11 @@ _elm_code_widget_newline(Elm_Code_Widget *widget)
1374 strlen(leading)); 1374 strlen(leading));
1375 elm_obj_code_widget_cursor_position_set(widget, row + 1, indent); 1375 elm_obj_code_widget_cursor_position_set(widget, row + 1, indent);
1376 efl_event_callback_legacy_call(widget, ELM_OBJ_CODE_WIDGET_EVENT_CHANGED_USER, NULL); 1376 efl_event_callback_legacy_call(widget, ELM_OBJ_CODE_WIDGET_EVENT_CHANGED_USER, NULL);
1377 free(leading);
1378 1377
1379 textlen = strlen(leading) + 2; 1378 textlen = strlen(leading) + 2;
1380 text = malloc(sizeof(char) * textlen); 1379 text = malloc(sizeof(char) * textlen);
1381 snprintf(text, textlen, "\n%s", leading); 1380 snprintf(text, textlen, "\n%s", leading);
1381 free(leading);
1382 1382
1383 change = _elm_code_widget_change_create(width + 1, row, indent - 1, row + 1, text, strlen(text), EINA_TRUE); 1383 change = _elm_code_widget_change_create(width + 1, row, indent - 1, row + 1, text, strlen(text), EINA_TRUE);
1384 _elm_code_widget_undo_change_add(widget, change); 1384 _elm_code_widget_undo_change_add(widget, change);