summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nsswitch/pam_winbind.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/nsswitch/pam_winbind.c b/nsswitch/pam_winbind.c
index f692316fc6..4e84574d25 100644
--- a/nsswitch/pam_winbind.c
+++ b/nsswitch/pam_winbind.c
@@ -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 */