regcomp(&pat_inittab, "([a-zA-Z0-9]*):([a-zA-Z0-9]*):([a-zA-Z0-9]*):(.*)", REG_EXTENDED);
line = malloc(LINE_LEN);
- a = malloc(sizeof(struct init_action));
- memset(a, 0, sizeof(struct init_action));
+ a = calloc(1, sizeof(struct init_action));
while (fgets(line, LINE_LEN, fp)) {
char *tags[TAG_PROCESS + 1];
if (add_action(a, tags[TAG_ACTION]))
continue;
line = malloc(LINE_LEN);
- a = malloc(sizeof(struct init_action));
- memset(a, 0, sizeof(struct init_action));
+ a = calloc(1, sizeof(struct init_action));
}
fclose(fp);
if (!name)
return;
- b = malloc(sizeof(*b));
+ b = calloc(1, sizeof(*b));
if (!b)
return;
- memset(b, 0, sizeof(*b));
-
b->data = malloc(blob_pad_len(data));
b->name = strdup(name);
b->seen = timeout;
void hotplug(char *rules)
{
- struct sockaddr_nl nls;
+ struct sockaddr_nl nls = {};
int nlbufsize = 512 * 1024;
rule_file = strdup(rules);
- memset(&nls,0,sizeof(struct sockaddr_nl));
nls.nl_family = AF_NETLINK;
nls.nl_pid = getpid();
nls.nl_groups = -1;