Author: jelmer
Date: 2005-08-29 19:08:18 +0000 (Mon, 29 Aug 2005)
New Revision: 9755

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=9755

Log:
Fix crash bug in SWAT login

Modified:
   branches/SAMBA_4_0/source/scripting/ejs/smbcalls_auth.c


Changeset:
Modified: branches/SAMBA_4_0/source/scripting/ejs/smbcalls_auth.c
===================================================================
--- branches/SAMBA_4_0/source/scripting/ejs/smbcalls_auth.c     2005-08-29 
18:52:24 UTC (rev 9754)
+++ branches/SAMBA_4_0/source/scripting/ejs/smbcalls_auth.c     2005-08-29 
19:08:18 UTC (rev 9755)
@@ -119,6 +119,9 @@
                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 @@
 
        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) {

Reply via email to