mirror of
https://github.com/samba-team/samba.git
synced 2024-12-27 03:21:53 +03:00
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
This commit is contained in:
parent
7cd5a79cd4
commit
466da70d77
@ -175,8 +175,16 @@ _PUBLIC_ size_t smb_iconv(smb_iconv_t cd,
|
|||||||
#ifndef SMB_ICONV_BUFSIZE
|
#ifndef SMB_ICONV_BUFSIZE
|
||||||
#define SMB_ICONV_BUFSIZE 2048
|
#define SMB_ICONV_BUFSIZE 2048
|
||||||
#endif
|
#endif
|
||||||
|
TALLOC_CTX *mem_ctx;
|
||||||
size_t bufsize;
|
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) {
|
if (!cvtbuf) {
|
||||||
return (size_t)-1;
|
return (size_t)-1;
|
||||||
|
Loading…
Reference in New Issue
Block a user