diff options
Diffstat (limited to 'source4/lib/appweb')
-rw-r--r-- | source4/lib/appweb/mpr/var.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source4/lib/appweb/mpr/var.c b/source4/lib/appweb/mpr/var.c index 9b02c0f8b0..77f4cbc55a 100644 --- a/source4/lib/appweb/mpr/var.c +++ b/source4/lib/appweb/mpr/var.c @@ -1416,7 +1416,9 @@ static void copyVarCore(MprVar *dest, MprVar *src, int copyDepth) break; case MPR_TYPE_PTR: - dest->ptr = src->ptr; + /* we have to reference here so talloc structures survive a + copy */ + dest->ptr = talloc_reference(dest, src->ptr); break; case MPR_TYPE_STRING_CFUNCTION: @@ -1477,7 +1479,7 @@ static void copyVarCore(MprVar *dest, MprVar *src, int copyDepth) srcProp->visited = 1; copyVarCore(destProp, srcProp, copyDepth); srcProp->visited = 0; - last = srcProp; + last = destProp; } } dest->properties->numItems = src->properties->numItems; |