summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2015-09-03 11:31:34 +0000
committertrasz <trasz@FreeBSD.org>2015-09-03 11:31:34 +0000
commit09a927822a53e076ff5e1656b8699206b1fb4bde (patch)
treea3023c022dbea9d69af8abf49eb1d85542ee94d9 /lib/libc
parent81554346534ca5247d6852cbbf3f3df38c08bfa8 (diff)
downloadFreeBSD-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.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