summaryrefslogtreecommitdiffstats
path: root/source
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
commit194c4640b158457a6d0d5ea91e28d41d619c77de (patch)
tree8e5bc22378a694d0b7c0bab9dff654ff9765e3db /source
parent7f6593cddef048dd05140b05d306c708d8134f0e (diff)
downloadsamba-194c4640b158457a6d0d5ea91e28d41d619c77de.tar.gz
samba-194c4640b158457a6d0d5ea91e28d41d619c77de.tar.xz
samba-194c4640b158457a6d0d5ea91e28d41d619c77de.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.
Diffstat (limited to 'source')
-rw-r--r--source/winbindd/winbindd_cm.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source/winbindd/winbindd_cm.c b/source/winbindd/winbindd_cm.c
index cb366a293c0..6c5633c2b2c 100644
--- a/source/winbindd/winbindd_cm.c
+++ b/source/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. */