aboutsummaryrefslogtreecommitdiffstats
path: root/swaybar/main.c
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2015-12-17 08:30:20 -0500
committerLibravatar Drew DeVault <sir@cmpwn.com>2015-12-17 08:30:45 -0500
commitd91185d67b831ea5015b00a4721e209513f87fc7 (patch)
tree78dfe8c102d4672b02befb6bda2d5f1f53e0df2d /swaybar/main.c
parentAdd PAM configuration for swaylock (diff)
downloadsway-d91185d67b831ea5015b00a4721e209513f87fc7.tar.gz
sway-d91185d67b831ea5015b00a4721e209513f87fc7.tar.zst
sway-d91185d67b831ea5015b00a4721e209513f87fc7.zip
Fix null dereference in swaybar
Diffstat (limited to 'swaybar/main.c')
-rw-r--r--swaybar/main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/swaybar/main.c b/swaybar/main.c
index d992b154..0a25d0f5 100644
--- a/swaybar/main.c
+++ b/swaybar/main.c
@@ -110,6 +110,10 @@ void ipc_update_workspaces() {
110 uint32_t len = 0; 110 uint32_t len = 0;
111 char *res = ipc_single_command(socketfd, IPC_GET_WORKSPACES, NULL, &len); 111 char *res = ipc_single_command(socketfd, IPC_GET_WORKSPACES, NULL, &len);
112 json_object *results = json_tokener_parse(res); 112 json_object *results = json_tokener_parse(res);
113 if (!results) {
114 free(res);
115 return;
116 }
113 117
114 int i; 118 int i;
115 for (i = 0; i < json_object_array_length(results); ++i) { 119 for (i = 0; i < json_object_array_length(results); ++i) {