From b54f5e170a2936bc272aca7fe44a90059f6da716 Mon Sep 17 00:00:00 2001
From: Ian Fan <ianfan0@gmail.com>
Date: Thu, 5 Mar 2020 16:28:43 +0000
Subject: [PATCH] swaybar: fix memory leaks

---
 swaybar/input.c | 3 +++
 swaybar/ipc.c   | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/swaybar/input.c b/swaybar/input.c
index c0352300c..f768cd406 100644
--- a/swaybar/input.c
+++ b/swaybar/input.c
@@ -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);
 	}
diff --git a/swaybar/ipc.c b/swaybar/ipc.c
index a3a9b4954..f3b7dd3da 100644
--- a/swaybar/ipc.c
+++ b/swaybar/ipc.c
@@ -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);
 }