summaryrefslogtreecommitdiff
path: root/lib/util/charset
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-03-31 08:25:32 +0200
committerVolker Lendecke <vlendec@samba.org>2011-03-31 09:14:01 +0200
commit466da70d7796b4c740b4e5d2dabb114e057cf400 (patch)
tree7997fd2425f6f9f26ff487a88f1f98a03d0e4675 /lib/util/charset
parent7cd5a79cd45fdc10d73ff32d81c4d86c5613f347 (diff)
downloadsamba-466da70d7796b4c740b4e5d2dabb114e057cf400.tar.gz
samba-466da70d7796b4c740b4e5d2dabb114e057cf400.tar.bz2
samba-466da70d7796b4c740b4e5d2dabb114e057cf400.zip
charconv: Use talloc_tos() in the S3 build
In S3 we put a talloc_pool on top of the stack so that an allocation from talloc_tos() normally is just a pointer increment. Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Thu Mar 31 09:14:01 CEST 2011 on sn-devel-104
Diffstat (limited to 'lib/util/charset')
-rw-r--r--lib/util/charset/iconv.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/util/charset/iconv.c b/lib/util/charset/iconv.c
index 74b931fa12..045fd1329b 100644
--- a/lib/util/charset/iconv.c
+++ b/lib/util/charset/iconv.c
@@ -175,8 +175,16 @@ _PUBLIC_ size_t smb_iconv(smb_iconv_t cd,
#ifndef SMB_ICONV_BUFSIZE
#define SMB_ICONV_BUFSIZE 2048
#endif
+ TALLOC_CTX *mem_ctx;
size_t bufsize;
- char *cvtbuf = talloc_array(cd, char, SMB_ICONV_BUFSIZE);
+ char *cvtbuf;
+
+#if _SAMBA_BUILD_ == 3
+ mem_ctx = talloc_tos();
+#else
+ mem_ctx = cd;
+#endif
+ cvtbuf = talloc_array(mem_ctx, char, SMB_ICONV_BUFSIZE);
if (!cvtbuf) {
return (size_t)-1;