summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/scripting/ejs/ejsnet.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/source4/scripting/ejs/ejsnet.c b/source4/scripting/ejs/ejsnet.c
index fea1608170..bed660aceb 100644
--- a/source4/scripting/ejs/ejsnet.c
+++ b/source4/scripting/ejs/ejsnet.c
@@ -106,10 +106,17 @@ static int ejs_net_createuser(MprVarHandle eid, int argc, char **argv)
req.in.user_name = argv[0];
status = libnet_CreateUser(ctx, mem_ctx, &req);
+ if (!NT_STATUS_IS_OK(status)) {
+ ejsSetErrorMsg(eid, "error when creating user: %s", nt_errstr(status));
+ }
talloc_free(mem_ctx);
+ mpr_Return(eid, mprNTSTATUS(status));
+ return 0;
+
done:
- return NT_STATUS_IS_OK(status) ? 0 : -1;
+ talloc_free(mem_ctx);
+ return -1;
}