summaryrefslogtreecommitdiffstats
path: root/lib/libc/posix1e/acl_strip.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/posix1e/acl_strip.c')
-rw-r--r--lib/libc/posix1e/acl_strip.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/lib/libc/posix1e/acl_strip.c b/lib/libc/posix1e/acl_strip.c
index 85dfb47..24fda84 100644
--- a/lib/libc/posix1e/acl_strip.c
+++ b/lib/libc/posix1e/acl_strip.c
@@ -107,13 +107,13 @@ _posix1e_acl_strip_np(const acl_t aclp, int recalculate_mask)
if (acl_get_permset(entry, &perm) == -1)
goto fail;
if (acl_create_entry(&acl_new, &entry_new) == -1)
- return (NULL);
+ goto fail;
if (acl_set_tag_type(entry_new, tag) == -1)
- return (NULL);
+ goto fail;
if (acl_set_permset(entry_new, perm) == -1)
- return (NULL);
+ goto fail;
if (acl_copy_entry(entry_new, entry) == -1)
- return (NULL);
+ goto fail;
assert(_entry_brand(entry_new) == ACL_BRAND_POSIX);
break;
case ACL_MASK:
@@ -122,20 +122,22 @@ _posix1e_acl_strip_np(const acl_t aclp, int recalculate_mask)
default:
break;
}
-fail:
- acl_free(acl_new);
- acl_free(acl_old);
- return (NULL);
}
assert(_acl_brand(acl_new) == ACL_BRAND_POSIX);
if (have_mask_entry && recalculate_mask) {
if (acl_calc_mask(&acl_new) == -1)
- return (NULL);
+ goto fail;
}
return (acl_new);
+
+fail:
+ acl_free(acl_new);
+ acl_free(acl_old);
+
+ return (NULL);
}
acl_t
OpenPOWER on IntegriCloud