diff options
author | Volker Lendecke <vl@samba.org> | 2021-01-15 15:16:55 +0100 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2021-01-22 19:54:38 +0000 |
commit | b4077f7911dbe340eb1a5ba166049f381b9f4c24 (patch) | |
tree | 2112ad6a89d7f3385ff2e03dd1849915c1dd85c2 /librpc | |
parent | c3ea181e76206a865d04be836111dd40f462cfff (diff) | |
download | samba-b4077f7911dbe340eb1a5ba166049f381b9f4c24.tar.gz |
librpc: Fix a small memleak in epm_floor_string()
Use GUID_buf_string(), don't leak the output of GUID_string()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'librpc')
-rw-r--r-- | librpc/rpc/binding.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/librpc/rpc/binding.c b/librpc/rpc/binding.c index 29be6ae16b2..80ab1a45134 100644 --- a/librpc/rpc/binding.c +++ b/librpc/rpc/binding.c @@ -137,7 +137,7 @@ const char *epm_floor_string(TALLOC_CTX *mem_ctx, struct epm_floor *epm_floor) status = dcerpc_floor_get_lhs_data(epm_floor, &syntax); if (NT_STATUS_IS_OK(status)) { /* lhs is used: UUID */ - char *uuidstr; + struct GUID_txt_buf buf; if (GUID_equal(&syntax.uuid, &ndr_transfer_syntax_ndr.uuid)) { return "NDR"; @@ -147,9 +147,11 @@ const char *epm_floor_string(TALLOC_CTX *mem_ctx, struct epm_floor *epm_floor) return "NDR64"; } - uuidstr = GUID_string(mem_ctx, &syntax.uuid); - - return talloc_asprintf(mem_ctx, " uuid %s/0x%02x", uuidstr, syntax.if_version); + return talloc_asprintf( + mem_ctx, + " uuid %s/0x%02x", + GUID_buf_string(&syntax.uuid, &buf), + syntax.if_version); } else { /* IPX */ return talloc_asprintf(mem_ctx, "IPX:%s", data_blob_hex_string_upper(mem_ctx, &epm_floor->rhs.uuid.unknown)); |