swaybar: fix memory leaks

This commit is contained in:
Ian Fan 2020-03-05 16:28:43 +00:00 committed by Simon Ser
parent df48c48123
commit b54f5e170a
2 changed files with 4 additions and 1 deletions

View file

@ -438,6 +438,9 @@ void swaybar_seat_free(struct swaybar_seat *seat) {
if (seat->pointer.pointer != NULL) {
wl_pointer_release(seat->pointer.pointer);
}
if (seat->pointer.cursor_theme != NULL) {
wl_cursor_theme_destroy(seat->pointer.cursor_theme);
}
if (seat->pointer.cursor_surface != NULL) {
wl_surface_destroy(seat->pointer.cursor_surface);
}

View file

@ -40,7 +40,7 @@ void ipc_send_workspace_command(struct swaybar *bar, const char *ws) {
command[d++] = ws[i];
}
ipc_single_command(bar->ipc_socketfd, IPC_COMMAND, command, &size);
free(ipc_single_command(bar->ipc_socketfd, IPC_COMMAND, command, &size));
free(command);
}