summaryrefslogtreecommitdiff
path: root/source3/lib/util_str.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-05-28 11:18:22 +0200
committerVolker Lendecke <vl@samba.org>2009-05-28 11:33:21 +0200
commit0dbecbbee5018108131869b13db649a058f4359d (patch)
treee49b14064ea1f1e27b55f65a9c32ab6a70151fd6 /source3/lib/util_str.c
parent01ea4249da246b0b99a4b89eb36aa6b1c0d46994 (diff)
downloadsamba-0dbecbbee5018108131869b13db649a058f4359d.tar.gz
samba-0dbecbbee5018108131869b13db649a058f4359d.tar.bz2
samba-0dbecbbee5018108131869b13db649a058f4359d.zip
Make sid_binstring & friends take a talloc context
Diffstat (limited to 'source3/lib/util_str.c')
-rw-r--r--source3/lib/util_str.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c
index 3a941f2c21..cdd7d0a300 100644
--- a/source3/lib/util_str.c
+++ b/source3/lib/util_str.c
@@ -1529,14 +1529,15 @@ size_t strlen_m_term_null(const char *s)
Caller must free.
**/
-char *binary_string_rfc2254(char *buf, int len)
+char *binary_string_rfc2254(TALLOC_CTX *mem_ctx, const uint8_t *buf, int len)
{
char *s;
int i, j;
const char *hex = "0123456789ABCDEF";
- s = (char *)SMB_MALLOC(len * 3 + 1);
- if (!s)
+ s = talloc_array(mem_ctx, char, len * 3 + 1);
+ if (s == NULL) {
return NULL;
+ }
for (j=i=0;i<len;i++) {
s[j] = '\\';
s[j+1] = hex[((unsigned char)buf[i]) >> 4];