From 9e6c6ce332a1d2b9e0387298e99bba824e0103a1 Mon Sep 17 00:00:00 2001 From: Brian Ashworth Date: Tue, 22 Jan 2019 14:00:33 -0500 Subject: swaybar: fix command malloc in workspace command This fixes a typo on the malloc line in ipc_send_workspace_command. The plus one to the size for the null-terminator was outside of the malloc call, which was causing the incorrect pointer to be freed later in the function. --- swaybar/ipc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'swaybar') diff --git a/swaybar/ipc.c b/swaybar/ipc.c index 46565202..bf1d0f43 100644 --- a/swaybar/ipc.c +++ b/swaybar/ipc.c @@ -20,7 +20,7 @@ void ipc_send_workspace_command(struct swaybar *bar, const char *ws) { } } - char *command = malloc(size) + 1; + char *command = malloc(size + 1); if (!command) { return; } -- cgit v1.2.3-54-g00ecf