summaryrefslogtreecommitdiff
path: root/nsswitch
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2015-03-03 16:11:26 +0100
committerRalph Böhme <slow@samba.org>2015-03-03 17:34:39 +0100
commitad3e38f6bb65fdf16cc792b97333a74d49f345bf (patch)
tree895250ab39a78e1d41b444068923db87c43052b5 /nsswitch
parentde1bf29d250849ebea1a3badd3e881035c1897b0 (diff)
downloadsamba-ad3e38f6bb65fdf16cc792b97333a74d49f345bf.tar.gz
pam: Fix CID 1034870 Resource leak
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
Diffstat (limited to 'nsswitch')
-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 f1b88cba4bb..c6467c76d8d 100644
--- a/nsswitch/pam_winbind.c
+++ b/nsswitch/pam_winbind.c
@@ -2436,6 +2436,7 @@ static char* winbind_upn_to_username(struct pwb_context *ctx,
char *domain = NULL;
char *name;
char *p;
+ char *result;
/* This cannot work when the winbind separator = @ */
@@ -2467,7 +2468,9 @@ static char* winbind_upn_to_username(struct pwb_context *ctx,
return NULL;
}
- return talloc_asprintf(ctx, "%s%c%s", domain, sep, name);
+ result = talloc_asprintf(ctx, "%s%c%s", domain, sep, name);
+ wbcFreeMemory(domain);
+ return result;
}
static int _pam_delete_cred(pam_handle_t *pamh, int flags,