mirror of
https://github.com/kovidgoyal/kitty.git
synced 2024-11-13 03:12:37 +03:00
Fix clipboard target properties and memory leak
This commit is contained in:
parent
ae8f3de070
commit
15e4be9051
4
glfw/x11_window.c
vendored
4
glfw/x11_window.c
vendored
@ -793,7 +793,7 @@ static Atom writeTargetToProperty(const XSelectionRequestEvent* request)
|
||||
32,
|
||||
PropModeReplace,
|
||||
(unsigned char*) targets,
|
||||
sizeof(targets[0]) * (aa->sz + 2));
|
||||
aa->sz + 2);
|
||||
free(targets);
|
||||
return request->property;
|
||||
}
|
||||
@ -2881,7 +2881,7 @@ void _glfwPlatformSetClipboard(GLFWClipboardType t) {
|
||||
}
|
||||
if (aa->capacity < cd->num_mime_types + 32) {
|
||||
aa->capacity = cd->num_mime_types + 32;
|
||||
aa->array = malloc(sizeof(aa->array[0]) * aa->capacity);
|
||||
aa->array = reallocarray(aa->array, aa->capacity, sizeof(aa->array[0]));
|
||||
}
|
||||
aa->sz = 0;
|
||||
for (size_t i = 0; i < cd->num_mime_types; i++) {
|
||||
|
Loading…
Reference in New Issue
Block a user