summaryrefslogtreecommitdiff
path: root/source3/lib/util_str.c
diff options
context:
space:
mode:
authorKai Blin <kai@samba.org>2008-01-19 02:12:35 +0100
committerKai Blin <kai@samba.org>2008-01-19 02:20:16 +0100
commit805caafd44cbc5fff49711b1a15fb64cc99f3ad3 (patch)
tree54c96bb7e84de810b3199b3a444ae27adef6d626 /source3/lib/util_str.c
parentb97fbf58886427fbb7f3181694bf6f9648f5d0f4 (diff)
downloadsamba-805caafd44cbc5fff49711b1a15fb64cc99f3ad3.tar.gz
samba-805caafd44cbc5fff49711b1a15fb64cc99f3ad3.tar.bz2
samba-805caafd44cbc5fff49711b1a15fb64cc99f3ad3.zip
util_str: Don't return memory from talloc_tos(), use mem_ctx instead.
(This used to be commit ab0ee6e9a6a9eee317228f0c2bde254ad9a59b85)
Diffstat (limited to 'source3/lib/util_str.c')
-rw-r--r--source3/lib/util_str.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c
index 3e3268104c..bcb9197141 100644
--- a/source3/lib/util_str.c
+++ b/source3/lib/util_str.c
@@ -2415,13 +2415,13 @@ void base64_decode_inplace(char *s)
}
/**
- * Encode a base64 string into a malloc()ed string caller to free.
+ * Encode a base64 string into a talloc()ed string caller to free.
*
* From SQUID: adopted from http://ftp.sunet.se/pub2/gnu/vm/base64-encode.c
* with adjustments
**/
-char *base64_encode_data_blob(DATA_BLOB data)
+char *base64_encode_data_blob(TALLOC_CTX *mem_ctx, DATA_BLOB data)
{
int bits = 0;
int char_count = 0;
@@ -2434,7 +2434,7 @@ char *base64_encode_data_blob(DATA_BLOB data)
out_cnt = 0;
len = data.length;
output_len = data.length * 2;
- result = TALLOC_ARRAY(talloc_tos(), char, output_len); /* get us plenty of space */
+ result = TALLOC_ARRAY(mem_ctx, char, output_len); /* get us plenty of space */
SMB_ASSERT(result != NULL);
while (len-- && out_cnt < (data.length * 2) - 5) {