From: Volker Lendecke Date: Thu, 31 Dec 2020 09:11:04 +0000 (+0100) Subject: librpc: Use GUID_buf_string in dcerpc_binding_string() X-Git-Tag: samba-4.14.0rc1~123 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=08da3439eddf26bdeece1a4e3c729e4dfcbd5d5e;p=thirdparty%2Fsamba.git librpc: Use GUID_buf_string in dcerpc_binding_string() Avoid a (small) memleak Signed-off-by: Volker Lendecke Reviewed-by: Samuel Cabrero Autobuild-User(master): Volker Lendecke Autobuild-Date(master): Mon Jan 11 14:25:04 UTC 2021 on sn-devel-184 --- diff --git a/librpc/rpc/binding.c b/librpc/rpc/binding.c index 75246dfd538..0a78be5bf16 100644 --- a/librpc/rpc/binding.c +++ b/librpc/rpc/binding.c @@ -227,9 +227,11 @@ _PUBLIC_ char *dcerpc_binding_string(TALLOC_CTX *mem_ctx, const struct dcerpc_bi } if (!GUID_all_zero(&b->object)) { + struct GUID_txt_buf buf; + o = s; - s = talloc_asprintf_append_buffer(s, "%s@", - GUID_string(mem_ctx, &b->object)); + s = talloc_asprintf_append_buffer( + s, "%s@", GUID_buf_string(&b->object, &buf)); if (s == NULL) { talloc_free(o); return NULL;