Clearer mallocs

This commit is contained in:
Pierre-Hugues Husson 2015-11-01 17:32:00 +01:00
parent e1a69b97db
commit 088ce9c2ad
1 changed files with 2 additions and 2 deletions

View File

@ -159,7 +159,7 @@ int add_rule(char *s, char *t, char *c, char *p, policydb_t *policy) {
av = avtab_search(&policy->te_avtab, &key);
if (av == NULL) {
av = cmalloc(sizeof av);
av = cmalloc(sizeof(*av));
av->data |= 1U << (perm->s.value - 1);
int ret = avtab_insert(&policy->te_avtab, &key, av);
if (ret) {
@ -208,7 +208,7 @@ int add_transition(char *srcS, char *fconS, char *tgtS, char *c, policydb_t *pol
av = avtab_search(&policy->te_avtab, &key);
if (av == NULL) {
av = cmalloc(sizeof av);
av = cmalloc(sizeof(*av));
av->data = tgt->s.value;
int ret = avtab_insert(&policy->te_avtab, &key, av);
if (ret) {