mirror of
https://github.com/swaywm/sway.git
synced 2024-12-04 12:26:45 +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(
|
return cmd_results_new(
|
||||||
CMD_FAILURE, "ipc", "Memory allocation error occured.");
|
CMD_FAILURE, "ipc", "Memory allocation error occured.");
|
||||||
}
|
}
|
||||||
current_policy = alloc_ipc_policy(program);
|
if ((current_policy = alloc_ipc_policy(program))) {
|
||||||
list_add(config->ipc_policies, current_policy);
|
list_add(config->ipc_policies, current_policy);
|
||||||
|
} else {
|
||||||
|
return cmd_results_new(
|
||||||
|
CMD_FAILURE, "ipc", "Failed to allocate security policy.");
|
||||||
|
}
|
||||||
|
|
||||||
free(program);
|
free(program);
|
||||||
return cmd_results_new(CMD_BLOCK_IPC, NULL, NULL);
|
return cmd_results_new(CMD_BLOCK_IPC, NULL, NULL);
|
||||||
|
|
Loading…
Reference in a new issue