summaryrefslogtreecommitdiffstats
path: root/source/auth
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-05-19 21:49:58 +0000
committerJeremy Allison <jra@samba.org>2004-05-19 21:49:58 +0000
commit4415c2f0ded271085a6ecae0cb9787956acd8b2a (patch)
tree0dad6b117262488ee99c0561ef50cf896db95a3d /source/auth
parentc281a391eae20510dde3be4cad755fbdb8b34de5 (diff)
downloadsamba-4415c2f0ded271085a6ecae0cb9787956acd8b2a.tar.gz
samba-4415c2f0ded271085a6ecae0cb9787956acd8b2a.tar.xz
samba-4415c2f0ded271085a6ecae0cb9787956acd8b2a.zip
r786: Memory leak fixes in (mostly) error code paths from
kawasa_r@itg.hitachi.co.jp. A couple of mem leak fixes in mainline code paths though :-). Jeremy.
Diffstat (limited to 'source/auth')
-rw-r--r--source/auth/auth_util.c3
-rw-r--r--source/auth/auth_winbind.c5
2 files changed, 5 insertions, 3 deletions
diff --git a/source/auth/auth_util.c b/source/auth/auth_util.c
index e6ed83a79af..9a03e7fe13c 100644
--- a/source/auth/auth_util.c
+++ b/source/auth/auth_util.c
@@ -1236,6 +1236,7 @@ NTSTATUS make_server_info_info3(TALLOC_CTX *mem_ctx,
info3->gids[i].g_rid));
SAFE_FREE(lgroupSIDs);
+ SAFE_FREE(all_group_SIDs);
free_server_info(server_info);
return nt_status;
@@ -1264,6 +1265,7 @@ NTSTATUS make_server_info_info3(TALLOC_CTX *mem_ctx,
if ( !NT_STATUS_IS_OK(nt_status) ) {
DEBUG(4,("create_nt_user_token failed\n"));
+ SAFE_FREE(lgroupSIDs);
SAFE_FREE(all_group_SIDs);
free_server_info(server_info);
return nt_status;
@@ -1271,6 +1273,7 @@ NTSTATUS make_server_info_info3(TALLOC_CTX *mem_ctx,
(*server_info)->ptok = token;
+ SAFE_FREE(lgroupSIDs);
SAFE_FREE(all_group_SIDs);
/* ensure we are never given NULL session keys */
diff --git a/source/auth/auth_winbind.c b/source/auth/auth_winbind.c
index 0e2820313e3..4260a0e80b4 100644
--- a/source/auth/auth_winbind.c
+++ b/source/auth/auth_winbind.c
@@ -127,9 +127,7 @@ static NTSTATUS check_winbind_security(const struct auth_context *auth_context,
if (result == NSS_STATUS_SUCCESS && response.extra_data) {
if (NT_STATUS_IS_OK(nt_status)) {
-
- if (NT_STATUS_IS_OK(nt_status = get_info3_from_ndr(mem_ctx, &response, &info3)))
- {
+ if (NT_STATUS_IS_OK(nt_status = get_info3_from_ndr(mem_ctx, &response, &info3))) {
nt_status = make_server_info_info3(mem_ctx,
user_info->internal_username.str,
user_info->smb_name.str, user_info->domain.str,
@@ -141,6 +139,7 @@ static NTSTATUS check_winbind_security(const struct auth_context *auth_context,
nt_status = NT_STATUS_NO_LOGON_SERVERS;
}
+ SAFE_FREE(response.extra_data);
return nt_status;
}