Fix memoy leaks in data offer reading

Signed-off-by: lishijie <lishijie22@h-partners.com>
Change-Id: I62c99ab9b6900f83e93d4014561ccc0405b6a765
This commit is contained in:
lishijie
2025-07-22 19:55:27 +08:00
parent f13d0ddac9
commit beea67f1a9
2 changed files with 3 additions and 0 deletions
+1
View File
@@ -128,6 +128,7 @@ information on what to include when reporting a bug.
- [Wayland] Bugfix: The fractional scaling related objects were not destroyed
- [Wayland] Bugfix: `glfwInit` would segfault on compositor with no seat (#2517)
- [Wayland] Bugfix: A drag entering a non-GLFW surface could cause a segfault
- [Wayland] Bugfix: Memory would leak if reading a data offer failed midway
- [Null] Added Vulkan 'window' surface creation via `VK_EXT_headless_surface`
- [Null] Added EGL context creation on Mesa via `EGL_MESA_platform_surfaceless`
- [EGL] Allowed native access on Wayland with `GLFW_CONTEXT_CREATION_API` set to
+2
View File
@@ -1329,6 +1329,7 @@ static char* readDataOfferAsString(struct wl_data_offer* offer, const char* mime
if (!longer)
{
_glfwInputError(GLFW_OUT_OF_MEMORY, NULL);
_glfw_free(string);
close(fds[0]);
return NULL;
}
@@ -1348,6 +1349,7 @@ static char* readDataOfferAsString(struct wl_data_offer* offer, const char* mime
_glfwInputError(GLFW_PLATFORM_ERROR,
"Wayland: Failed to read from data offer pipe: %s",
strerror(errno));
_glfw_free(string);
close(fds[0]);
return NULL;
}