diff options
author | Volker Lendecke <vl@samba.org> | 2021-01-22 19:59:52 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2021-01-28 16:58:35 +0000 |
commit | eed1257268e96123d9655527071c00d0ab38f803 (patch) | |
tree | ad761685f16924f1645d757d76705ad0759f0b08 /librpc | |
parent | 243ce602129232e50313099f094cf09a848a2ab0 (diff) | |
download | samba-eed1257268e96123d9655527071c00d0ab38f803.tar.gz |
librpc: Use ndr_syntax_id_buf_string() in dcerpc_binding_set_abstract_syntax()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
Diffstat (limited to 'librpc')
-rw-r--r-- | librpc/rpc/binding.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/librpc/rpc/binding.c b/librpc/rpc/binding.c index 05daccca7df..57ceed012f4 100644 --- a/librpc/rpc/binding.c +++ b/librpc/rpc/binding.c @@ -648,7 +648,7 @@ _PUBLIC_ NTSTATUS dcerpc_binding_set_abstract_syntax(struct dcerpc_binding *b, const struct ndr_syntax_id *syntax) { NTSTATUS status; - char *s = NULL; + struct ndr_syntax_id_buf buf; if (syntax == NULL) { status = dcerpc_binding_set_string_option(b, "abstract_syntax", NULL); @@ -668,18 +668,9 @@ _PUBLIC_ NTSTATUS dcerpc_binding_set_abstract_syntax(struct dcerpc_binding *b, return NT_STATUS_OK; } - s = ndr_syntax_id_to_string(b, syntax); - if (s == NULL) { - return NT_STATUS_NO_MEMORY; - } - - status = dcerpc_binding_set_string_option(b, "abstract_syntax", s); - TALLOC_FREE(s); - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - return NT_STATUS_OK; + status = dcerpc_binding_set_string_option( + b, "abstract_syntax", ndr_syntax_id_buf_string(syntax, &buf)); + return status; } _PUBLIC_ const char *dcerpc_binding_get_string_option(const struct dcerpc_binding *b, |