From b386371f57ba45e6ef15d16e994c6fbe71437427 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Tue, 22 Mar 2022 18:55:31 +0100 Subject: [PATCH] Wayland: Fix double free on data source error If data source creation fails, the string containing the data for it would be freed a second time during termination. --- README.md | 1 + src/wl_window.c | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index c0e319bf..210edf82 100644 --- a/README.md +++ b/README.md @@ -312,6 +312,7 @@ information on what to include when reporting a bug. - [Wayland] Bugfix: `glfwPostEmptyEvent` sometimes had no effect (#1520,#1521) - [Wayland] Bugfix: `glfwSetClipboardString` would fail if set to result of `glfwGetClipboardString` + - [Wayland] Bugfix: Data source creation error would cause double free at termination - [POSIX] Removed use of deprecated function `gettimeofday` - [POSIX] Bugfix: `CLOCK_MONOTONIC` was not correctly tested for or enabled - [WGL] Disabled the DWM swap interval hack for Windows 8 and later (#1072) diff --git a/src/wl_window.c b/src/wl_window.c index a1b717ee..c2a88f5b 100644 --- a/src/wl_window.c +++ b/src/wl_window.c @@ -1683,6 +1683,7 @@ void _glfwSetClipboardStringWayland(const char* string) _glfwInputError(GLFW_PLATFORM_ERROR, "Wayland: Impossible to create clipboard source"); _glfw_free(_glfw.wl.clipboardSendString); + _glfw.wl.clipboardSendString = NULL; return; } wl_data_source_add_listener(_glfw.wl.dataSource,