summaryrefslogtreecommitdiff
path: root/source3/lib/util_str.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@sernet.de>2007-10-28 19:15:08 +0100
committerStefan Metzmacher <metze@samba.org>2007-11-09 15:12:30 +0100
commit62b97b01561e332d3b566c4f70cc2601e2d7fcac (patch)
treee3f57396a7f07d01b953c26ac947ca4884e358ba /source3/lib/util_str.c
parente63bcdd720d801df278ef84063c46144df087793 (diff)
downloadsamba-62b97b01561e332d3b566c4f70cc2601e2d7fcac.tar.gz
samba-62b97b01561e332d3b566c4f70cc2601e2d7fcac.tar.bz2
samba-62b97b01561e332d3b566c4f70cc2601e2d7fcac.zip
Make base64_encode_data_blob return a talloced string
(This used to be commit 5f205ab48d8ac3b7af573ea0be1ce095ab835448)
Diffstat (limited to 'source3/lib/util_str.c')
-rw-r--r--source3/lib/util_str.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c
index 6458ae3e05..f1078c6383 100644
--- a/source3/lib/util_str.c
+++ b/source3/lib/util_str.c
@@ -2528,7 +2528,8 @@ char *base64_encode_data_blob(DATA_BLOB data)
out_cnt = 0;
len = data.length;
output_len = data.length * 2;
- result = (char *)SMB_MALLOC(output_len); /* get us plenty of space */
+ result = TALLOC_ARRAY(talloc_tos(), char, output_len); /* get us plenty of space */
+ SMB_ASSERT(result != NULL);
while (len-- && out_cnt < (data.length * 2) - 5) {
int c = (unsigned char) *(data.data++);