Skip to content

Commit

Permalink
Call wl_display_disconnect on non-null display only
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-fedin authored and john-preston committed Jul 28, 2024
1 parent c0ba7b3 commit 4a60ce1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/modules/desktop_capture/desktop_capturer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ bool DesktopCapturer::IsRunningUnderWayland() {
(void)dlerror();
if (wl_display_connect && wl_display_disconnect) {
const auto display = wl_display_connect(nullptr);
wl_display_disconnect(display);
if (display)
wl_display_disconnect(display);
dlclose(lib);
return display;
}
Expand Down

0 comments on commit 4a60ce1

Please sign in to comment.