From d4f22109ee5b939d34fe11ad4cef29d22fd82cc8 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 29 Aug 2005 19:08:18 +0000 Subject: [PATCH] r9755: Fix crash bug in SWAT login (This used to be commit 6e3e964fb4529260c2fcb09b41eda1a100e690eb) --- source4/scripting/ejs/smbcalls_auth.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source4/scripting/ejs/smbcalls_auth.c b/source4/scripting/ejs/smbcalls_auth.c index 8df69cf0873..e3b48490f6c 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) { -- 2.34.1