summaryrefslogtreecommitdiff
path: root/source3/nsswitch
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-06-28 04:43:19 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:19:03 -0500
commit61578c2308f7e3bbeca6e5effb29cebee5e17e8e (patch)
tree4ae86674ab124f60adce9174207909419a6f57fa /source3/nsswitch
parentc1dbb16945d82bd1a41ff64811b727bdbef6a26f (diff)
downloadsamba-61578c2308f7e3bbeca6e5effb29cebee5e17e8e.tar.gz
samba-61578c2308f7e3bbeca6e5effb29cebee5e17e8e.tar.bz2
samba-61578c2308f7e3bbeca6e5effb29cebee5e17e8e.zip
r16610: Subtle one from Klocwork #2076. If multiple flags
are set in a winbindd request it might overwrite existing state->response.extra_data.data values without freeing. Jeremy. (This used to be commit 4e7262c81ad2945048cb8d0789af032a05008988)
Diffstat (limited to 'source3/nsswitch')
-rw-r--r--source3/nsswitch/winbindd_pam.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source3/nsswitch/winbindd_pam.c b/source3/nsswitch/winbindd_pam.c
index 1eb2659905..34d23ebf8f 100644
--- a/source3/nsswitch/winbindd_pam.c
+++ b/source3/nsswitch/winbindd_pam.c
@@ -97,6 +97,7 @@ static NTSTATUS append_info3_as_ndr(TALLOC_CTX *mem_ctx,
}
size = prs_data_size(&ps);
+ SAFE_FREE(state->response.extra_data.data);
state->response.extra_data.data = SMB_MALLOC(size);
if (!state->response.extra_data.data) {
prs_mem_free(&ps);
@@ -1365,6 +1366,7 @@ done:
cell += 1;
/* Append an AFS token string */
+ SAFE_FREE(state->response.extra_data.data);
state->response.extra_data.data =
afs_createtoken_str(afsname, cell);
@@ -1614,6 +1616,7 @@ enum winbindd_result winbindd_dual_pam_auth_crap(struct winbindd_domain *domain,
DEBUG(5, ("Setting unix username to [%s]\n", username_out));
+ SAFE_FREE(state->response.extra_data.data);
state->response.extra_data.data = SMB_STRDUP(username_out);
if (!state->response.extra_data.data) {
result = NT_STATUS_NO_MEMORY;