aboutsummaryrefslogtreecommitdiff
path: root/xwayland/selection/incoming.c
diff options
context:
space:
mode:
authorTudor Brindus <me@tbrindus.ca>2021-01-24 20:25:00 -0500
committerSimon Ser <contact@emersion.fr>2021-01-25 09:46:20 +0100
commit0db191d3bfd7715b0609792a3117d04acc700063 (patch)
tree024f5e709633c91785e771a224c57ba65fd3f786 /xwayland/selection/incoming.c
parentabb56152ffceb8af8e9b288df0358ac6b7cd5f5d (diff)
xwayland/selection: prevent fd leak on unsupported MIME type
Since we never end up calling xcb_convert_selection, the file descriptor ends up getting leaked (i.e., not cleaned up within xwm_data_source_write).
Diffstat (limited to 'xwayland/selection/incoming.c')
-rw-r--r--xwayland/selection/incoming.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/xwayland/selection/incoming.c b/xwayland/selection/incoming.c
index 7e2a0c14..257cccf1 100644
--- a/xwayland/selection/incoming.c
+++ b/xwayland/selection/incoming.c
@@ -158,6 +158,7 @@ static void source_send(struct wlr_xwm_selection *selection,
if (!found) {
wlr_log(WLR_DEBUG, "Cannot send X11 selection to Wayland: "
"unsupported MIME type");
+ close(fd);
return;
}