summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-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) {