diff options
author | Volker Lendecke <vl@samba.org> | 2011-03-31 08:25:32 +0200 |
---|---|---|
committer | Volker Lendecke <vlendec@samba.org> | 2011-03-31 09:14:01 +0200 |
commit | 466da70d7796b4c740b4e5d2dabb114e057cf400 (patch) | |
tree | 7997fd2425f6f9f26ff487a88f1f98a03d0e4675 /lib/util | |
parent | 7cd5a79cd45fdc10d73ff32d81c4d86c5613f347 (diff) | |
download | samba-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')
-rw-r--r-- | lib/util/charset/iconv.c | 10 |
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; |