Skip to content

Commit

Permalink
Wayland: Fixed file descriptor leaks if device was not initialized.
Browse files Browse the repository at this point in the history
  • Loading branch information
philippwiesemann committed Nov 17, 2016
1 parent c345126 commit d05a39d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/video/wayland/SDL_waylanddatamanager.c
Expand Up @@ -347,10 +347,10 @@ Wayland_data_offer_receive(SDL_WaylandDataOffer *offer,

if (offer == NULL) {
SDL_SetError("Invalid data offer");
} else if (pipe2(pipefd, O_CLOEXEC|O_NONBLOCK) == -1) {
SDL_SetError("Could not read pipe");
} else if ((data_device = offer->data_device) == NULL) {
SDL_SetError("Data device not initialized");
} else if (pipe2(pipefd, O_CLOEXEC|O_NONBLOCK) == -1) {
SDL_SetError("Could not read pipe");
} else {
wl_data_offer_receive(offer->offer, mime_type, pipefd[1]);

Expand Down

0 comments on commit d05a39d

Please sign in to comment.