mirror of
https://github.com/swaywm/sway.git
synced 2024-12-03 20:06:42 +00:00
Fix NULL deref in cmd_ipc
This commit is contained in:
parent
403dccabce
commit
02dfa15d30
|
@ -32,8 +32,12 @@ struct cmd_results *cmd_ipc(int argc, char **argv) {
|
|||
return cmd_results_new(
|
||||
CMD_FAILURE, "ipc", "Memory allocation error occured.");
|
||||
}
|
||||
current_policy = alloc_ipc_policy(program);
|
||||
list_add(config->ipc_policies, current_policy);
|
||||
if ((current_policy = alloc_ipc_policy(program))) {
|
||||
list_add(config->ipc_policies, current_policy);
|
||||
} else {
|
||||
return cmd_results_new(
|
||||
CMD_FAILURE, "ipc", "Failed to allocate security policy.");
|
||||
}
|
||||
|
||||
free(program);
|
||||
return cmd_results_new(CMD_BLOCK_IPC, NULL, NULL);
|
||||
|
|
Loading…
Reference in a new issue