summaryrefslogtreecommitdiff
path: root/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c
diff options
context:
space:
mode:
authorChristopher Michael <devilhorns@comcast.net>2020-03-10 10:28:01 -0400
committerChristopher Michael <devilhorns@comcast.net>2020-03-10 10:28:01 -0400
commitbe87c4a0c22a88014d2061e255a7a1b65706efa1 (patch)
tree2fe16ea363298026a770f03ab729fb7a07ea14ed /src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c
parente34837f28d3ec03da584ffce8648a8ede4294aa8 (diff)
ecore-evas-wayland: Fix resource leak
If we are going to be exiting this function without setting up the ecore_main_fd_handler (and thus passing forign_slice), then we should free forign_slice as it was previously calloc'd above. Fixes CID1420322
Diffstat (limited to '')
-rw-r--r--src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c
index b2bf7c75ec..0c80b501cb 100644
--- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c
+++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c
@@ -2645,7 +2645,7 @@ _wl_interaction_send(void *data, int type EINA_UNUSED, void *event)
2645 if (buffer == ECORE_EVAS_SELECTION_BUFFER_LAST) 2645 if (buffer == ECORE_EVAS_SELECTION_BUFFER_LAST)
2646 { 2646 {
2647 //silent return, this send request was *not* for this window 2647 //silent return, this send request was *not* for this window
2648 return ECORE_CALLBACK_PASS_ON; 2648 goto end;
2649 } 2649 }
2650 2650
2651 selection = &wdata->selection_data[buffer]; 2651 selection = &wdata->selection_data[buffer];
@@ -2653,7 +2653,11 @@ _wl_interaction_send(void *data, int type EINA_UNUSED, void *event)
2653 EINA_SAFETY_ON_NULL_GOTO(selection->callbacks.delivery, end); 2653 EINA_SAFETY_ON_NULL_GOTO(selection->callbacks.delivery, end);
2654 EINA_SAFETY_ON_FALSE_GOTO(selection->callbacks.delivery(ee, ev->seat, buffer, ev->type, &forign_slice->slice), end); 2654 EINA_SAFETY_ON_FALSE_GOTO(selection->callbacks.delivery(ee, ev->seat, buffer, ev->type, &forign_slice->slice), end);
2655 ecore_main_fd_handler_add(ev->fd, ECORE_FD_WRITE, _write_to_fd, forign_slice, NULL, NULL); 2655 ecore_main_fd_handler_add(ev->fd, ECORE_FD_WRITE, _write_to_fd, forign_slice, NULL, NULL);
2656
2657 return ECORE_CALLBACK_PASS_ON;
2658
2656end: 2659end:
2660 free(forign_slice);
2657 return ECORE_CALLBACK_PASS_ON; 2661 return ECORE_CALLBACK_PASS_ON;
2658} 2662}
2659 2663