diff options
author | Andrew Tridgell <tridge@samba.org> | 2009-05-28 22:12:00 +1000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2009-05-28 22:12:00 +1000 |
commit | 67b83d2489788f1899c253fdab554d0998f9c044 (patch) | |
tree | 637060cb6bd4ab16fa9464d2bc168ad6c99e0b11 /source3/lib/util_str.c | |
parent | 08be1420ba52ef9bba90d0f811c7810841ee8568 (diff) | |
parent | e63d9c29c99c5311c9f4a8dbe432ff4cea4fb924 (diff) | |
download | samba-67b83d2489788f1899c253fdab554d0998f9c044.tar.gz samba-67b83d2489788f1899c253fdab554d0998f9c044.tar.bz2 samba-67b83d2489788f1899c253fdab554d0998f9c044.zip |
Merge branch 'master' of ssh://git.samba.org/data/git/samba
Diffstat (limited to 'source3/lib/util_str.c')
-rw-r--r-- | source3/lib/util_str.c | 7 |
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]; |