diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-08-22 01:51:02 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:34:18 -0500 |
commit | 81556a90785c90f928690929c5735bc3ee9c8eca (patch) | |
tree | ffdd9e7643f262d05bf10006b0d1c2c922581a85 /source4/scripting | |
parent | 86e796643e2993ef3e3fb8b88faecf1261f01f10 (diff) | |
download | samba-81556a90785c90f928690929c5735bc3ee9c8eca.tar.gz samba-81556a90785c90f928690929c5735bc3ee9c8eca.tar.bz2 samba-81556a90785c90f928690929c5735bc3ee9c8eca.zip |
r9464: fixed a problem with child pointers copied into non-allocated mpr variables. We
now use the same free technique as is used for mpr strings, rather than relying on
being a child of the variable
(This used to be commit 3d6739eaa6e1b56d67bc7d9b5350a6911c96597a)
Diffstat (limited to 'source4/scripting')
-rw-r--r-- | source4/scripting/ejs/mprutil.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source4/scripting/ejs/mprutil.c b/source4/scripting/ejs/mprutil.c index 8f1e5f71c8..38cfd2c493 100644 --- a/source4/scripting/ejs/mprutil.c +++ b/source4/scripting/ejs/mprutil.c @@ -369,12 +369,14 @@ void mprSetPtr(struct MprVar *v, const char *propname, const void *p) } /* - set a pointer in a existing MprVar, making it a child of the property + set a pointer in a existing MprVar, freeing it when the property goes away */ void mprSetPtrChild(struct MprVar *v, const char *propname, const void *p) { mprSetVar(v, propname, mprCreatePtrVar(discard_const(p))); - talloc_steal(mprGetProperty(v, propname, NULL), p); + v = mprGetProperty(v, propname, NULL); + v->allocatedData = 1; + talloc_steal(mprMemCtx(), p); } /* |