diff options
author | trasz <trasz@FreeBSD.org> | 2015-09-03 11:31:34 +0000 |
---|---|---|
committer | trasz <trasz@FreeBSD.org> | 2015-09-03 11:31:34 +0000 |
commit | 09a927822a53e076ff5e1656b8699206b1fb4bde (patch) | |
tree | a3023c022dbea9d69af8abf49eb1d85542ee94d9 /lib/libc | |
parent | 81554346534ca5247d6852cbbf3f3df38c08bfa8 (diff) | |
download | FreeBSD-src-09a927822a53e076ff5e1656b8699206b1fb4bde.zip FreeBSD-src-09a927822a53e076ff5e1656b8699206b1fb4bde.tar.gz |
Fix acl_strip_np(3) breakage introduced in r279962.
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/posix1e/acl_strip.c | 20 |
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 |