diff options
author | Volker Lendecke <vl@sernet.de> | 2007-10-28 19:15:08 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2007-11-09 15:12:30 +0100 |
commit | 62b97b01561e332d3b566c4f70cc2601e2d7fcac (patch) | |
tree | e3f57396a7f07d01b953c26ac947ca4884e358ba /source3/lib | |
parent | e63bcdd720d801df278ef84063c46144df087793 (diff) | |
download | samba-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')
-rw-r--r-- | source3/lib/afs.c | 6 | ||||
-rw-r--r-- | source3/lib/util_str.c | 3 |
2 files changed, 5 insertions, 4 deletions
diff --git a/source3/lib/afs.c b/source3/lib/afs.c index e9a7059028..35f213fd08 100644 --- a/source3/lib/afs.c +++ b/source3/lib/afs.c @@ -53,7 +53,7 @@ static char *afs_encode_token(const char *cell, const DATA_BLOB ticket, base64_key = base64_encode_data_blob(key); if (base64_key == NULL) { - free(base64_ticket); + TALLOC_FREE(base64_ticket); return NULL; } @@ -63,8 +63,8 @@ static char *afs_encode_token(const char *cell, const DATA_BLOB ticket, DEBUG(10, ("Got ticket string:\n%s\n", result)); - free(base64_ticket); - free(base64_key); + TALLOC_FREE(base64_ticket); + TALLOC_FREE(base64_key); return result; } 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++); |