diff options
author | Brian Ashworth <bosrsf04@gmail.com> | 2019-01-22 14:00:33 -0500 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2019-01-22 20:10:19 +0100 |
commit | 9e6c6ce332a1d2b9e0387298e99bba824e0103a1 (patch) | |
tree | 3405f6544b8b704895b63e7d8243cc17aa99a6c8 /swaybar/ipc.c | |
parent | background-image.c: remove stdbool header (diff) | |
download | sway-9e6c6ce332a1d2b9e0387298e99bba824e0103a1.tar.gz sway-9e6c6ce332a1d2b9e0387298e99bba824e0103a1.tar.zst sway-9e6c6ce332a1d2b9e0387298e99bba824e0103a1.zip |
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.
Diffstat (limited to 'swaybar/ipc.c')
-rw-r--r-- | swaybar/ipc.c | 2 |
1 files changed, 1 insertions, 1 deletions
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) { | |||
20 | } | 20 | } |
21 | } | 21 | } |
22 | 22 | ||
23 | char *command = malloc(size) + 1; | 23 | char *command = malloc(size + 1); |
24 | if (!command) { | 24 | if (!command) { |
25 | return; | 25 | return; |
26 | } | 26 | } |