aboutsummaryrefslogtreecommitdiff
path: root/sway/security.c
blob: 6a00229ed2e82ef6d39fb7069b68e8b6dbfd6238 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#define _POSIX_C_SOURCE 200809L
#include <stdlib.h>
#include <string.h>
#include "sway/security.h"

struct command_policy *alloc_command_policy(const char *command) {
	struct command_policy *policy = malloc(sizeof(struct command_policy));
	if (!policy) {
		return NULL;
	}
	policy->command = strdup(command);
	if (!policy->command) {
		free(policy);
		return NULL;
	}
	policy->context = 0;
	return policy;
}