secacl: Slightly simplify make_sec_acl
authorVolker Lendecke <vl@samba.org>
Fri, 6 Dec 2013 09:29:19 +0000 (09:29 +0000)
committerJeremy Allison <jra@samba.org>
Fri, 13 Dec 2013 23:10:21 +0000 (00:10 +0100)
This avoids a complex if-expression

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Dec 14 00:10:21 CET 2013 on sn-devel-104

libcli/security/secacl.c

index 61cf52134a617579a6f787a853e5f39d26194048..8d2ae102f0701e44c46d30ee0f16c2344fceffa3 100644 (file)
@@ -54,9 +54,12 @@ struct security_acl *make_sec_acl(TALLOC_CTX *ctx,
           entries in it.  This is achieved by checking that num_aces is a
           positive number. */
 
-       if ((num_aces) &&
-            ((dst->aces = talloc_array(dst, struct security_ace, num_aces))
-             == NULL)) {
+       if (num_aces == 0) {
+               return dst;
+       }
+
+       dst->aces = talloc_array(dst, struct security_ace, num_aces);
+       if (dst->aces == NULL) {
                TALLOC_FREE(dst);
                return NULL;
        }