Summary: Since we end up calling free on the event->data parameter
after a drop is completed, we should actually be allocating a string
for this data (to be free'd later). This also fixes an issue where the
event length was not being set.
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Dropable *drop;
unsigned int win = 0;
Elm_Selection_Data sdata;
- static const char *tagstring =
- "<item absize=240x180 href=file://%s></item>";
+ int len = 0;
+ char *s = NULL;
win = _wl_elm_widget_window_get(sel->requestwidget);
drop = _wl_dropable_find_geom(win, savedtypes.x, savedtypes.y);
+ len = strlen(data);
+ if (!(s = malloc(len + 1))) return;
+ memcpy(s, data, len);
+ s[len] = 0;
+
if (savedtypes.textreq)
{
savedtypes.textreq = 0;
- savedtypes.imgfile = data;
+ savedtypes.imgfile = s;
}
+ sdata.len = len;
sdata.x = savedtypes.x;
sdata.y = savedtypes.y;