summaryrefslogtreecommitdiff
path: root/source4/lib/charset/iconv.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib/charset/iconv.c')
-rw-r--r--source4/lib/charset/iconv.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/source4/lib/charset/iconv.c b/source4/lib/charset/iconv.c
index 937b3ec8b5..db212a83c4 100644
--- a/source4/lib/charset/iconv.c
+++ b/source4/lib/charset/iconv.c
@@ -154,17 +154,17 @@ static bool is_utf16(const char *name)
strcasecmp(name, "UTF-16LE") == 0;
}
-/*
- simple iconv_open() wrapper
- */
-smb_iconv_t smb_iconv_open(const char *tocode, const char *fromcode,
- bool native_iconv)
+
+
+smb_iconv_t smb_iconv_open_ex(TALLOC_CTX *mem_ctx, const char *tocode,
+ const char *fromcode, bool native_iconv)
{
smb_iconv_t ret;
const struct charset_functions *from=NULL, *to=NULL;
int i;
- ret = (smb_iconv_t)talloc_named(NULL, sizeof(*ret),
+ ret = (smb_iconv_t)talloc_named(mem_ctx,
+ sizeof(*ret),
"iconv(%s,%s)", tocode, fromcode);
if (!ret) {
errno = ENOMEM;
@@ -261,6 +261,14 @@ failed:
}
/*
+ simple iconv_open() wrapper
+ */
+smb_iconv_t smb_iconv_open(const char *tocode, const char *fromcode)
+{
+ return smb_iconv_open_ex(NULL, tocode, fromcode, true);
+}
+
+/*
simple iconv_close() wrapper
*/
int smb_iconv_close(smb_iconv_t cd)