[client] wayland: fix use after free bugs

This commit is contained in:
Geoffrey McRae committed 2023-11-11 13:48:41 +11:00
1 parent f6befb4567
commit 3c1405719c
2 files changed
+8

No files matched your search

@@ -475,6 +475,7 @@ void waylandCBRequest(LG_ClipboardData type)
close(data->fd);
free(data->buf);
free(data);
return;
}
wlCb.currentRead = data;
@@ -109,10 +109,17 @@ void waylandPresentationFrame(void)
return;
struct FrameData * data = malloc(sizeof(*data));
if (!data)
{
DEBUG_ERROR("out of memory");
return;
}
if (clock_gettime(wlWm.clkId, &data->sent))
{
DEBUG_ERROR("clock_gettime failed: %s\n", strerror(errno));
free(data);
return;
}
struct wp_presentation_feedback * feedback = wp_presentation_feedback(wlWm.presentation, wlWm.surface);