1
0
mirror of https://github.com/samba-team/samba.git synced 2025-10-25 19:33:18 +03:00

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 commit is contained in:
Andrew Tridgell
2005-08-22 01:51:02 +00:00
committed by Gerald (Jerry) Carter
parent de66450c24
commit 3d6739eaa6
2 changed files with 17 additions and 3 deletions

View File

@@ -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);
}
/*