mirror of
https://github.com/swaywm/sway.git
synced 2024-12-27 15:36:29 +01:00
Fix null dereference in swaybar
This commit is contained in:
parent
7b8f02146f
commit
d91185d67b
1 changed files with 4 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue