summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Hirt <daniel.hirt@samsung.com>2014-02-04 15:02:54 +0200
committerDaniel Zaoui <daniel.zaoui@samsung.com>2014-02-09 13:22:24 +0200
commite025c1a93afb6acb9cf2f0a394cf73e3fcec87c1 (patch)
tree47e9a972395912195e7bdeb89b5a7dbd99ed688a
parent37eb8fd233365e2922d9d0b372bd040d697f2555 (diff)
elm cnp: fix freeing selection buf
Moved a misplaced ELM_SAFE_FREE of the selection buffer, as valgrind still showed lost bytes with selection.
-rw-r--r--src/lib/elm_cnp.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/lib/elm_cnp.c b/src/lib/elm_cnp.c
index a23562f2d..f4880036c 100644
--- a/src/lib/elm_cnp.c
+++ b/src/lib/elm_cnp.c
@@ -1752,12 +1752,12 @@ _x11_elm_cnp_selection_set(Ecore_X_Window xwin, Evas_Object *obj, Elm_Sel_Type s
1752 evas_object_event_callback_add 1752 evas_object_event_callback_add
1753 (sel->widget, EVAS_CALLBACK_DEL, _x11_sel_obj_del, sel); 1753 (sel->widget, EVAS_CALLBACK_DEL, _x11_sel_obj_del, sel);
1754 1754
1755 ELM_SAFE_FREE(sel->selbuf, free);
1755 if (selbuf) 1756 if (selbuf)
1756 { 1757 {
1757 if (format == ELM_SEL_FORMAT_IMAGE) 1758 if (format == ELM_SEL_FORMAT_IMAGE)
1758 { 1759 {
1759 // selbuf is actual image data, not text/string 1760 // selbuf is actual image data, not text/string
1760 ELM_SAFE_FREE(sel->selbuf, free);
1761 sel->selbuf = malloc(buflen + 1); 1761 sel->selbuf = malloc(buflen + 1);
1762 if (!sel->selbuf) 1762 if (!sel->selbuf)
1763 { 1763 {
@@ -1770,8 +1770,6 @@ _x11_elm_cnp_selection_set(Ecore_X_Window xwin, Evas_Object *obj, Elm_Sel_Type s
1770 else 1770 else
1771 sel->selbuf = strdup((char*)selbuf); 1771 sel->selbuf = strdup((char*)selbuf);
1772 } 1772 }
1773 else
1774 sel->selbuf = NULL;
1775 1773
1776 return EINA_TRUE; 1774 return EINA_TRUE;
1777} 1775}