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.

(cherry picked from commit b386371f57)
This commit is contained in:
Camilla Löwy
2022-03-22 18:55:31 +01:00
parent 22f718dcf4
commit 53bd67ccfe
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -1817,6 +1817,7 @@ void _glfwPlatformSetClipboardString(const char* string)
_glfwInputError(GLFW_PLATFORM_ERROR,
"Wayland: Impossible to create clipboard source");
free(_glfw.wl.clipboardSendString);
_glfw.wl.clipboardSendString = NULL;
return;
}
wl_data_source_add_listener(_glfw.wl.dataSource,