From 5b7b8f8f8c89f8754458916870d63353a4e46f09 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 28 Dec 2024 22:35:55 +0100 Subject: Global hotkeys: fix incorrect free --- tools/gsr-global-hotkeys/keyboard_event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools/gsr-global-hotkeys') diff --git a/tools/gsr-global-hotkeys/keyboard_event.c b/tools/gsr-global-hotkeys/keyboard_event.c index ef8f6ef..63aeeef 100644 --- a/tools/gsr-global-hotkeys/keyboard_event.c +++ b/tools/gsr-global-hotkeys/keyboard_event.c @@ -305,10 +305,10 @@ static void keyboard_event_remove_event(keyboard_event *self, int index) { ioctl(self->event_polls[index].fd, EVIOCGRAB, 0); close(self->event_polls[index].fd); + free(self->event_extra_data[index].key_states); for(int i = index + 1; i < self->num_event_polls; ++i) { self->event_polls[i - 1] = self->event_polls[i]; - free(self->event_extra_data[i - 1].key_states); self->event_extra_data[i - 1] = self->event_extra_data[i]; } --self->num_event_polls; -- cgit v1.2.3