r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text
[tprouty/samba.git] / source / utils / net_rpc_samsync.c
index 904e49bbb34951778b3d71bf91cc5da1606b4195..0be9381c3ac78165e49ca8b305fffdc3f40548f9 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"
@@ -212,7 +211,7 @@ static void dump_database(struct rpc_pipe_client *pipe_hnd, uint32 db_type)
                result = rpccli_netlogon_sam_sync(pipe_hnd, mem_ctx, db_type,
                                               sync_context,
                                               &num_deltas, &hdr_deltas, &deltas);
-               if (NT_STATUS_IS_ERR(result))
+               if (!NT_STATUS_IS_OK(result))
                        break;
 
                 for (i = 0; i < num_deltas; i++) {
@@ -670,10 +669,14 @@ static NTSTATUS fetch_group_mem_info(uint32 rid, SAM_GROUP_MEM_INFO *delta)
                return NT_STATUS_NO_MEMORY;
        }
 
-       if ((nt_members = TALLOC_ZERO_ARRAY(t, char *, delta->num_members)) == NULL) {
-               DEBUG(0, ("talloc failed\n"));
-               talloc_free(t);
-               return NT_STATUS_NO_MEMORY;
+       if (delta->num_members) {
+               if ((nt_members = TALLOC_ZERO_ARRAY(t, char *, delta->num_members)) == NULL) {
+                       DEBUG(0, ("talloc failed\n"));
+                       talloc_free(t);
+                       return NT_STATUS_NO_MEMORY;
+               }
+       } else {
+               nt_members = NULL;
        }
 
        for (i=0; i<delta->num_members; i++) {