summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorGregor Beck <gbeck@sernet.de>2011-03-16 09:12:28 +0100
committerMichael Adam <obnox@samba.org>2011-04-04 15:57:35 +0200
commit10cec2f0ec752cbec2055b0aa878b4814f3c1309 (patch)
tree95026b4e4c7179e3212e282eca5a087a761cad68 /source3/lib
parentb7e330a2b325463e49abceb8f3e8d792248179ed (diff)
downloadsamba-10cec2f0ec752cbec2055b0aa878b4814f3c1309.tar.gz
samba-10cec2f0ec752cbec2055b0aa878b4814f3c1309.tar.bz2
samba-10cec2f0ec752cbec2055b0aa878b4814f3c1309.zip
s3: fix cbuf_swapptr
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/cbuf.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/source3/lib/cbuf.c b/source3/lib/cbuf.c
index e9763ae403..16dd52c292 100644
--- a/source3/lib/cbuf.c
+++ b/source3/lib/cbuf.c
@@ -116,8 +116,10 @@ cbuf* cbuf_takeover(cbuf* b1, cbuf* b2)
cbuf* cbuf_swapptr(cbuf* b, char** ptr, size_t len)
{
+ void* p = talloc_parent(*ptr);
SWAP(b->buf, *ptr, char*);
talloc_steal(b, b->buf);
+ talloc_steal(p, *ptr);
b->size = talloc_get_size(b->buf);
b->pos = (len == -1) ? strlen(b->buf) : len;