r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text
[tprouty/samba.git] / source / nsswitch / winbindd_group.c
index df2a75c244b35d52735d88a13a7e583fd755dc55..9a4b02f7343bfc92bac6dc73e3cb1885c03be26a 100644 (file)
@@ -10,7 +10,7 @@
    
    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 2 of the License, or
+   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,
@@ -19,8 +19,7 @@
    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, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 #include "includes.h"
@@ -391,7 +390,7 @@ static NTSTATUS expand_groups( TALLOC_CTX *ctx,
                               char ***members, uint32 *n_members )
 {
        int i, j;       
-       NTSTATUS status;
+       NTSTATUS status = NT_STATUS_OK;
        uint32 num_names = 0;
        uint32 *name_types = NULL;
        char **names = NULL;
@@ -456,7 +455,7 @@ static NTSTATUS expand_groups( TALLOC_CTX *ctx,
                TALLOC_FREE( tmp_ctx );
        }
 
-       new_glist = &new_groups;
+       *new_glist = new_groups;
        *n_new_glist = (uint32)new_groups_size; 
        
  out:
@@ -543,7 +542,7 @@ static BOOL fill_grent_mem(struct winbindd_domain *domain,
        n_glist = 1;    
 
        for ( i=0; i<max_depth && glist; i++ ) {
-               size_t n_members = 0;
+               uint32 n_members = 0;
                char **members = NULL;
                NTSTATUS nt_status;             
 
@@ -576,6 +575,7 @@ static BOOL fill_grent_mem(struct winbindd_domain *domain,
                /* One more round */
                TALLOC_FREE(glist);
                glist = new_glist;
+               n_glist = n_new_glist;
        }
        TALLOC_FREE( glist );