summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-08-29 19:08:18 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:34:56 -0500
commitd4f22109ee5b939d34fe11ad4cef29d22fd82cc8 (patch)
tree522d68cba9458824f0effa251b9f2dff088ce326
parent11f3f0fa6cfb0486bdc526465dc4c0e19467a30f (diff)
downloadsamba-d4f22109ee5b939d34fe11ad4cef29d22fd82cc8.tar.gz
samba-d4f22109ee5b939d34fe11ad4cef29d22fd82cc8.tar.bz2
samba-d4f22109ee5b939d34fe11ad4cef29d22fd82cc8.zip
r9755: Fix crash bug in SWAT login
(This used to be commit 6e3e964fb4529260c2fcb09b41eda1a100e690eb)
-rw-r--r--source4/scripting/ejs/smbcalls_auth.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source4/scripting/ejs/smbcalls_auth.c b/source4/scripting/ejs/smbcalls_auth.c
index 8df69cf087..e3b48490f6 100644
--- a/source4/scripting/ejs/smbcalls_auth.c
+++ b/source4/scripting/ejs/smbcalls_auth.c
@@ -119,6 +119,9 @@ static int ejs_userAuth(MprVarHandle eid, int argc, struct MprVar **argv)
ejsSetErrorMsg(eid, "userAuth requires a 'creds' element");
return -1;
}
+
+ tmp_ctx = talloc_new(mprMemCtx());
+
username = cli_credentials_get_username(creds, tmp_ctx);
password = cli_credentials_get_password(creds);
domain = cli_credentials_get_domain(creds);
@@ -126,10 +129,10 @@ static int ejs_userAuth(MprVarHandle eid, int argc, struct MprVar **argv)
if (username == NULL || password == NULL || domain == NULL) {
mpr_Return(eid, mprCreateUndefinedVar());
+ talloc_free(tmp_ctx);
return 0;
}
- tmp_ctx = talloc_new(mprMemCtx());
auth = mprObject("auth");
if (domain && strcmp("System User", domain) == 0) {