[crash fix] don't use already free'ed memory
authorStefan Metzmacher <metze@samba.org>
Wed, 24 Oct 2007 12:29:06 +0000 (14:29 +0200)
committerStefan Metzmacher <metze@samba.org>
Wed, 24 Oct 2007 13:31:29 +0000 (15:31 +0200)
(found by "make valgrindtest" and my "start winbindd on make test" patch)

metze
(cherry picked from commit fe21e48489852720a05b305b251e4f5cbb200f7a)

source/groupdb/mapping.c

index 6520a42f2afcab2afcf150ad0cc2ee8a206a3986..b0e59c0ddd3d7d0dd2f018198267712951ce26e9 100644 (file)
@@ -724,12 +724,12 @@ NTSTATUS pdb_create_builtin_alias(uint32 rid)
                return NT_STATUS_ACCESS_DENIED;
        }
 
-       DEBUG(10,("Creating alias %s with gid %d\n", name, gid));
+       DEBUG(10,("Creating alias %s with gid %d\n", groupname, gid));
 
        map.gid = gid;
        sid_copy(&map.sid, &sid);
        map.sid_name_use = SID_NAME_ALIAS;
-       fstrcpy(map.nt_name, name);
+       fstrcpy(map.nt_name, groupname);
        fstrcpy(map.comment, "");
 
        status = pdb_add_group_mapping_entry(&map);