s3: add failure check.
authorBo Yang <boyang@samba.org>
Sat, 18 Jul 2009 06:07:33 +0000 (14:07 +0800)
committerBo Yang <boyang@samba.org>
Sat, 18 Jul 2009 06:12:26 +0000 (14:12 +0800)
Signed-off-by: Bo Yang <boyang@samba.org>
nsswitch/pam_winbind.c

index f692316fc63d6a1469581025e28fb144d0a722d4..4e84574d258b3a9db57fc4efcf2b108265810e3d 100644 (file)
@@ -2298,9 +2298,12 @@ static char* winbind_upn_to_username(struct pwb_context *ctx,
        }
 
        name = talloc_strdup(ctx, upn);
+       if (!name) {
+               return NULL;
+       }
        if ((p = strchr(name, '@')) != NULL) {
                *p = 0;
-               domain = talloc_strdup(ctx, p + 1);
+               domain = p + 1;
        }
 
        /* Convert the UPN to a SID */