summaryrefslogtreecommitdiff
path: root/source4/auth
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-09-26 05:38:45 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:59:16 -0500
commitdf6dce1065d4323ebf8ca97b69f0a44804f19e11 (patch)
tree6088ff1c986dc5078d94fa2cf1129f82367dbad4 /source4/auth
parentec0128ef012f4280b2fb607cb9c88c7673894fe6 (diff)
downloadsamba-df6dce1065d4323ebf8ca97b69f0a44804f19e11.tar.gz
samba-df6dce1065d4323ebf8ca97b69f0a44804f19e11.tar.bz2
samba-df6dce1065d4323ebf8ca97b69f0a44804f19e11.zip
r2650: fixed a memory leak in make_server_info()
(This used to be commit 4aba6e7101041100f7d400abd5e7144b95528fc3)
Diffstat (limited to 'source4/auth')
-rw-r--r--source4/auth/auth_builtin.c2
-rw-r--r--source4/auth/auth_sam.c2
-rw-r--r--source4/auth/auth_server.c2
-rw-r--r--source4/auth/auth_unix.c2
-rw-r--r--source4/auth/auth_util.c9
5 files changed, 9 insertions, 8 deletions
diff --git a/source4/auth/auth_builtin.c b/source4/auth/auth_builtin.c
index aa5355059c..30f50806dc 100644
--- a/source4/auth/auth_builtin.c
+++ b/source4/auth/auth_builtin.c
@@ -43,7 +43,7 @@ static NTSTATUS check_guest_security(const struct auth_context *auth_context,
if (!(user_info->internal_username.str
&& *user_info->internal_username.str)) {
- nt_status = make_server_info_guest(server_info);
+ nt_status = make_server_info_guest(auth_context, server_info);
}
return nt_status;
diff --git a/source4/auth/auth_sam.c b/source4/auth/auth_sam.c
index 74c8edcb82..8c86328c05 100644
--- a/source4/auth/auth_sam.c
+++ b/source4/auth/auth_sam.c
@@ -304,7 +304,7 @@ static NTSTATUS check_sam_security(const struct auth_context *auth_context,
return nt_status;
}
- if (!NT_STATUS_IS_OK(nt_status = make_server_info(server_info, username))) {
+ if (!NT_STATUS_IS_OK(nt_status = make_server_info(auth_context, server_info, username))) {
DEBUG(0,("check_sam_security: make_server_info_sam() failed with '%s'\n", nt_errstr(nt_status)));
return nt_status;
}
diff --git a/source4/auth/auth_server.c b/source4/auth/auth_server.c
index be272e625c..d0c4bfc902 100644
--- a/source4/auth/auth_server.c
+++ b/source4/auth/auth_server.c
@@ -354,7 +354,7 @@ use this machine as the password server.\n"));
if NT_STATUS_IS_OK(nt_status) {
struct passwd *pass = Get_Pwnam(user_info->internal_username.str);
if (pass) {
- nt_status = make_server_info_pw(server_info, pass);
+ nt_status = make_server_info_pw(auth_context, server_info, pass);
} else {
nt_status = NT_STATUS_NO_SUCH_USER;
}
diff --git a/source4/auth/auth_unix.c b/source4/auth/auth_unix.c
index b7c3475e55..01868dd949 100644
--- a/source4/auth/auth_unix.c
+++ b/source4/auth/auth_unix.c
@@ -108,7 +108,7 @@ static NTSTATUS check_unix_security(const struct auth_context *auth_context,
if (NT_STATUS_IS_OK(nt_status)) {
if (pass) {
- make_server_info_pw(server_info, pass);
+ make_server_info_pw(auth_context, server_info, pass);
} else {
/* we need to do somthing more useful here */
nt_status = NT_STATUS_NO_SUCH_USER;
diff --git a/source4/auth/auth_util.c b/source4/auth/auth_util.c
index f508cff35e..93799cf36b 100644
--- a/source4/auth/auth_util.c
+++ b/source4/auth/auth_util.c
@@ -399,10 +399,11 @@ NTSTATUS create_nt_user_token(TALLOC_CTX *mem_ctx,
Make a user_info struct
***************************************************************************/
-NTSTATUS make_server_info(struct auth_serversupplied_info **server_info,
+NTSTATUS make_server_info(TALLOC_CTX *mem_ctx,
+ struct auth_serversupplied_info **server_info,
const char *username)
{
- *server_info = talloc_p(NULL, struct auth_serversupplied_info);
+ *server_info = talloc_p(mem_ctx, struct auth_serversupplied_info);
if (!*server_info) {
DEBUG(0,("make_server_info: malloc failed!\n"));
return NT_STATUS_NO_MEMORY;
@@ -415,12 +416,12 @@ NTSTATUS make_server_info(struct auth_serversupplied_info **server_info,
/***************************************************************************
Make (and fill) a user_info struct for a guest login.
***************************************************************************/
-NTSTATUS make_server_info_guest(struct auth_serversupplied_info **server_info)
+NTSTATUS make_server_info_guest(TALLOC_CTX *mem_ctx, struct auth_serversupplied_info **server_info)
{
NTSTATUS nt_status;
static const char zeros[16];
- nt_status = make_server_info(server_info, "");
+ nt_status = make_server_info(mem_ctx, server_info, "");
if (!NT_STATUS_IS_OK(nt_status)) {
return nt_status;