summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerald (Jerry) Carter <jerry@samba.org>2007-12-17 17:33:48 -0600
committerGerald (Jerry) Carter <jerry@samba.org>2007-12-17 17:33:48 -0600
commitd9553e8fd19a0832f3fbd19ffcc595a701d87e34 (patch)
tree238f5f55e463d16e9f32e8ca2c67411aa6cd8158
parentd9682dfb5918c20516d45de20c4f3d5824572e20 (diff)
downloadsamba-d9553e8fd19a0832f3fbd19ffcc595a701d87e34.tar.gz
samba-d9553e8fd19a0832f3fbd19ffcc595a701d87e34.tar.bz2
samba-d9553e8fd19a0832f3fbd19ffcc595a701d87e34.zip
Fix a segv in winbindd caused by trying to free an fstring.
Make a copy of the machine_password and machine_account strings in all conditional paths so that SAFE_FREE() will always be valid. (This used to be commit 194c4640b158457a6d0d5ea91e28d41d619c77de)
-rw-r--r--source3/winbindd/winbindd_cm.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c
index cb366a293c..6c5633c2b2 100644
--- a/source3/winbindd/winbindd_cm.c
+++ b/source3/winbindd/winbindd_cm.c
@@ -2005,11 +2005,15 @@ NTSTATUS cm_connect_sam(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
domain_name = domain->name;
goto schannel;
} else {
- machine_password = conn_pwd;
- machine_account = conn->cli->user_name;
+ machine_password = SMB_STRDUP(conn_pwd);
+ machine_account = SMB_STRDUP(conn->cli->user_name);
domain_name = conn->cli->domain;
}
+ if (!machine_password || !machine_account) {
+ result = NT_STATUS_NO_MEMORY;
+ goto done;
+ }
/* We have an authenticated connection. Use a NTLMSSP SPNEGO
authenticated SAMR pipe with sign & seal. */