The branch, master has been updated
       via  eaf807c secacl: Slightly simplify make_sec_acl
       via  4ec6571 secacl: Fix a memleak in an error path
       via  b6e323b secacl: Don't use talloc_zero
       via  2b11359 secacl: Fix whitespace
      from  ce975e6 s4:rpc_server/lsa_lookup fix a compile warning

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit eaf807c361fc412405217e4b1199549f9925970b
Author: Volker Lendecke <v...@samba.org>
Date:   Fri Dec 6 09:29:19 2013 +0000

    secacl: Slightly simplify make_sec_acl
    
    This avoids a complex if-expression
    
    Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>
    
    Autobuild-User(master): Jeremy Allison <j...@samba.org>
    Autobuild-Date(master): Sat Dec 14 00:10:21 CET 2013 on sn-devel-104

commit 4ec65713fe21b7993fb4fe27754ff32b52775f1d
Author: Volker Lendecke <v...@samba.org>
Date:   Fri Dec 6 09:28:40 2013 +0000

    secacl: Fix a memleak in an error path
    
    Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

commit b6e323bcf61c0db013122f321c11dba4211af17e
Author: Volker Lendecke <v...@samba.org>
Date:   Fri Dec 6 09:26:25 2013 +0000

    secacl: Don't use talloc_zero
    
    We initialize all but one field anyway
    
    Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

commit 2b113599f8a95b9d5c031511a2515ce9ffe98af2
Author: Volker Lendecke <v...@samba.org>
Date:   Fri Dec 6 09:25:20 2013 +0000

    secacl: Fix whitespace
    
    Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

-----------------------------------------------------------------------

Summary of changes:
 libcli/security/secacl.c |   35 +++++++++++++++++++++--------------
 1 files changed, 21 insertions(+), 14 deletions(-)


Changeset truncated at 500 lines:

diff --git a/libcli/security/secacl.c b/libcli/security/secacl.c
index 47184ae..8d2ae10 100644
--- a/libcli/security/secacl.c
+++ b/libcli/security/secacl.c
@@ -1,21 +1,21 @@
-/* 
+/*
  *  Unix SMB/Netbios implementation.
  *  SEC_ACL handling routines
  *  Copyright (C) Andrew Tridgell              1992-1998,
  *  Copyright (C) Jeremy R. Allison            1995-2003.
  *  Copyright (C) Luke Kenneth Casson Leighton 1996-1998,
  *  Copyright (C) Paul Ashton                  1997-1998.
- *  
+ *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
  *  the Free Software Foundation; either version 3 of the License, or
  *  (at your option) any later version.
- *  
+ *
  *  This program is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  *  GNU General Public License for more details.
- *  
+ *
  *  You should have received a copy of the GNU General Public License
  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
@@ -28,22 +28,25 @@
 #define  SEC_ACL_HEADER_SIZE (2 * sizeof(uint16_t) + sizeof(uint32_t))
 
 /*******************************************************************
- Create a SEC_ACL structure.  
+ Create a SEC_ACL structure.
 ********************************************************************/
 
-struct security_acl *make_sec_acl(TALLOC_CTX *ctx, 
-                                                                 enum 
security_acl_revision revision,
-                                                                 int num_aces, 
struct security_ace *ace_list)
+struct security_acl *make_sec_acl(TALLOC_CTX *ctx,
+                                 enum security_acl_revision revision,
+                                 int num_aces, struct security_ace *ace_list)
 {
        struct security_acl *dst;
        int i;
 
-       if((dst = talloc_zero(ctx, struct security_acl)) == NULL)
+       dst = talloc(ctx, struct security_acl);
+       if (dst == NULL) {
                return NULL;
+       }
 
        dst->revision = revision;
        dst->num_aces = num_aces;
        dst->size = SEC_ACL_HEADER_SIZE;
+       dst->aces = NULL;
 
        /* Now we need to return a non-NULL address for the ace list even
           if the number of aces required is zero.  This is because there
@@ -51,12 +54,16 @@ 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;
        }
-        
+
        for (i = 0; i < num_aces; i++) {
                dst->aces[i] = ace_list[i]; /* Structure copy. */
                dst->size += ace_list[i].size;
@@ -66,7 +73,7 @@ struct security_acl *make_sec_acl(TALLOC_CTX *ctx,
 }
 
 /*******************************************************************
- Duplicate a SEC_ACL structure.  
+ Duplicate a SEC_ACL structure.
 ********************************************************************/
 
 struct security_acl *dup_sec_acl(TALLOC_CTX *ctx, struct security_acl *src)


-- 
Samba Shared Repository

Reply via email to