summaryrefslogtreecommitdiffstats
path: root/lib/libc/posix1e/acl_strip.c
diff options
context:
space:
mode:
authorbapt <bapt@FreeBSD.org>2015-10-13 19:44:36 +0000
committerbapt <bapt@FreeBSD.org>2015-10-13 19:44:36 +0000
commitc8d6d4a78596005d50c30c7ab4f623a601ef0b39 (patch)
treee5218cae2f48913719be46210d8d92085cb2511f /lib/libc/posix1e/acl_strip.c
parent2a77c3b71d27973d4ffac086902715be69266202 (diff)
parent384c892651c52e57063356328dfcd28914bc4b15 (diff)
downloadFreeBSD-src-c8d6d4a78596005d50c30c7ab4f623a601ef0b39.zip
FreeBSD-src-c8d6d4a78596005d50c30c7ab4f623a601ef0b39.tar.gz
Merge from head
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