summaryrefslogtreecommitdiff
path: root/source4/scripting
diff options
context:
space:
mode:
Diffstat (limited to 'source4/scripting')
-rw-r--r--source4/scripting/ejs/mprutil.c6
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);
}
/*