diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-07-10 02:37:50 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:19:30 -0500 |
commit | 60ec75cbc7dccfceec9c57799e2af5be21a08609 (patch) | |
tree | 2e98a1f002878f63264f3e22b2f4ad46f488ca4d /source4/scripting/ejs/ejsrpc.c | |
parent | 1e5b309b4fc15dcc48007d856a954a2bea08b380 (diff) | |
download | samba-60ec75cbc7dccfceec9c57799e2af5be21a08609.tar.gz |
r8276: fixed the remaining memory leaks in smbscript. We can now loop doing
lots of rpc calls without memory usage increasing.
(This used to be commit 9c885a7edb771486793eb287288158157b34e8f3)
Diffstat (limited to 'source4/scripting/ejs/ejsrpc.c')
-rw-r--r-- | source4/scripting/ejs/ejsrpc.c | 59 |
1 files changed, 1 insertions, 58 deletions
diff --git a/source4/scripting/ejs/ejsrpc.c b/source4/scripting/ejs/ejsrpc.c index f2c2b258e43..8b6bc328dde 100644 --- a/source4/scripting/ejs/ejsrpc.c +++ b/source4/scripting/ejs/ejsrpc.c @@ -22,6 +22,7 @@ #include "includes.h" #include "lib/ejs/ejs.h" +#include "scripting/ejs/smbcalls.h" #include "librpc/gen_ndr/ndr_security.h" #include "librpc/gen_ndr/ndr_lsa.h" #include "scripting/ejs/ejsrpc.h" @@ -44,64 +45,6 @@ NTSTATUS ejs_panic(struct ejs_rpc *ejs, const char *why) } /* - find a mpr component, allowing for sub objects, using the '.' convention -*/ -static NTSTATUS mprGetVar(struct MprVar **v, const char *name) -{ - const char *p = strchr(name, '.'); - char *objname; - NTSTATUS status; - if (p == NULL) { - *v = mprGetProperty(*v, name, NULL); - if (*v == NULL) { - DEBUG(1,("mprGetVar unable to find '%s'\n", name)); - return NT_STATUS_INVALID_PARAMETER; - } - return NT_STATUS_OK; - } - objname = talloc_strndup(mprMemCtx(), name, p-name); - NT_STATUS_HAVE_NO_MEMORY(objname); - *v = mprGetProperty(*v, objname, NULL); - NT_STATUS_HAVE_NO_MEMORY(*v); - status = mprGetVar(v, p+1); - talloc_free(objname); - return status; -} - - -/* - set a mpr component, allowing for sub objects, using the '.' convention -*/ -static NTSTATUS mprSetVar(struct MprVar *v, const char *name, struct MprVar val) -{ - const char *p = strchr(name, '.'); - char *objname; - struct MprVar *v2; - NTSTATUS status; - if (p == NULL) { - v2 = mprSetProperty(v, name, &val); - if (v2 == NULL) { - DEBUG(1,("mprSetVar unable to set '%s'\n", name)); - return NT_STATUS_INVALID_PARAMETER_MIX; - } - return NT_STATUS_OK; - } - objname = talloc_strndup(mprMemCtx(), name, p-name); - if (objname == NULL) { - return NT_STATUS_NO_MEMORY; - } - v2 = mprGetProperty(v, objname, NULL); - if (v2 == NULL) { - struct MprVar val2 = mprCreateObjVar(objname, MPR_DEFAULT_HASH_SIZE); - v2 = mprCreateProperty(v, objname, &val2); - } - status = mprSetVar(v2, p+1, val); - talloc_free(objname); - return status; -} - - -/* start the ejs pull process for a structure */ NTSTATUS ejs_pull_struct_start(struct ejs_rpc *ejs, struct MprVar **v, const char *name) |