s3: use smb_xmemdup instead of smb_memdup and smb_panic
authorBjörn Baumbach <bb@sernet.de>
Mon, 14 Apr 2014 12:42:56 +0000 (14:42 +0200)
committerJeremy Allison <jra@samba.org>
Wed, 16 Apr 2014 20:53:42 +0000 (22:53 +0200)
Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Apr 16 22:53:42 CEST 2014 on sn-devel-104

source3/smbd/sec_ctx.c

index c34247e615acd5054a7ef582e26b95a0e5180b70..5dda07e6c08263db8dab547f76ced8379a7531a6 100644 (file)
@@ -331,11 +331,8 @@ void set_sec_ctx(uid_t uid, gid_t gid, int ngroups, gid_t *groups, const struct
        TALLOC_FREE(ctx_p->token);
 
        if (ngroups) {
-               ctx_p->ut.groups = (gid_t *)smb_memdup(groups,
-                                                      sizeof(gid_t) * ngroups);
-               if (!ctx_p->ut.groups) {
-                       smb_panic("memdup failed");
-               }
+               ctx_p->ut.groups = (gid_t *)smb_xmemdup(groups,
+                                                       sizeof(gid_t) * ngroups);
        } else {
                ctx_p->ut.groups = NULL;
        }