summaryrefslogtreecommitdiff
path: root/lib/util/util.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2008-11-13 21:26:03 +0100
committerStefan Metzmacher <metze@samba.org>2008-11-16 16:24:33 +0100
commit64b6d2d3e3bddd51a792c2ea9a4bdbcfcc5f0666 (patch)
treed6052b9324b9688291097d4439efed75215dbdc7 /lib/util/util.c
parent536de25faef82611e61b12126d432368badeed65 (diff)
downloadsamba-64b6d2d3e3bddd51a792c2ea9a4bdbcfcc5f0666.tar.gz
samba-64b6d2d3e3bddd51a792c2ea9a4bdbcfcc5f0666.tar.bz2
samba-64b6d2d3e3bddd51a792c2ea9a4bdbcfcc5f0666.zip
lib/util: hex_encode_talloc(): fix error path and set talloc name
metze
Diffstat (limited to 'lib/util/util.c')
-rw-r--r--lib/util/util.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/util/util.c b/lib/util/util.c
index 4e2a5aab09..7548d30b7e 100644
--- a/lib/util/util.c
+++ b/lib/util/util.c
@@ -701,10 +701,14 @@ _PUBLIC_ char *hex_encode_talloc(TALLOC_CTX *mem_ctx, const unsigned char *buff_
char *hex_buffer;
hex_buffer = talloc_array(mem_ctx, char, (len*2)+1);
+ if (!hex_buffer) {
+ return NULL;
+ }
for (i = 0; i < len; i++)
slprintf(&hex_buffer[i*2], 3, "%02X", buff_in[i]);
+ talloc_set_name_const(hex_buffer, hex_buffer);
return hex_buffer;
}