diff options
author | Drew DeVault <sir@cmpwn.com> | 2015-12-17 08:30:20 -0500 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2015-12-17 08:30:45 -0500 |
commit | d91185d67b831ea5015b00a4721e209513f87fc7 (patch) | |
tree | 78dfe8c102d4672b02befb6bda2d5f1f53e0df2d /swaybar | |
parent | 7b8f02146fb6279bd9437cecda758a2f4303aea9 (diff) |
Fix null dereference in swaybar
Diffstat (limited to 'swaybar')
-rw-r--r-- | swaybar/main.c | 4 |
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() { uint32_t len = 0; char *res = ipc_single_command(socketfd, IPC_GET_WORKSPACES, NULL, &len); json_object *results = json_tokener_parse(res); + if (!results) { + free(res); + return; + } int i; for (i = 0; i < json_object_array_length(results); ++i) { |