The branch, master has been updated via b8f7167 libdgram: Fix an error path memleak via 8b770e6 libnbt: Align data types via 5fea3e3 libnbt: Add an explicit "mem_ctx" to name_request_send from ce63db2 traffic_relay: bulk port print to modern py3 style
https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit b8f71674742a45c296b6ef6a69be3870c4ddf61c Author: Volker Lendecke <v...@samba.org> Date: Sun Feb 25 13:00:39 2018 +0100 libdgram: Fix an error path memleak Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Stefan Metzmacher <me...@samba.org> Autobuild-User(master): Stefan Metzmacher <me...@samba.org> Autobuild-Date(master): Fri Apr 13 21:04:28 CEST 2018 on sn-devel-144 commit 8b770e646aa28e6ef36647f42b97a8330203bbd0 Author: Volker Lendecke <v...@samba.org> Date: Thu Apr 12 20:40:32 2018 +0200 libnbt: Align data types ARRAY_SIZE returns size_t Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Stefan Metzmacher <me...@samba.org> commit 5fea3e3f23cf75e111b9043ddad8a93aad6c06bf Author: Volker Lendecke <v...@samba.org> Date: Sun Feb 4 12:16:14 2018 +0000 libnbt: Add an explicit "mem_ctx" to name_request_send Implicitly hanging requests off nbtsock is too inflexible for future use Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Stefan Metzmacher <me...@samba.org> ----------------------------------------------------------------------- Summary of changes: libcli/nbt/namequery.c | 4 ++-- libcli/nbt/namerefresh.c | 2 +- libcli/nbt/nameregister.c | 2 +- libcli/nbt/namerelease.c | 2 +- libcli/nbt/nbt_proto.h | 3 ++- libcli/nbt/nbtsocket.c | 7 ++++--- source4/libcli/dgram/mailslot.c | 1 + 7 files changed, 12 insertions(+), 9 deletions(-) Changeset truncated at 500 lines: diff --git a/libcli/nbt/namequery.c b/libcli/nbt/namequery.c index e344235..49ab10c 100644 --- a/libcli/nbt/namequery.c +++ b/libcli/nbt/namequery.c @@ -56,7 +56,7 @@ _PUBLIC_ struct nbt_name_request *nbt_name_query_send(struct nbt_name_socket *nb dest = socket_address_from_strings(packet, nbtsock->sock->backend_name, io->in.dest_addr, io->in.dest_port); if (dest == NULL) goto failed; - req = nbt_name_request_send(nbtsock, dest, packet, + req = nbt_name_request_send(nbtsock, nbtsock, dest, packet, io->in.timeout, io->in.retries, false); if (req == NULL) goto failed; @@ -160,7 +160,7 @@ _PUBLIC_ struct nbt_name_request *nbt_name_status_send(struct nbt_name_socket *n dest = socket_address_from_strings(packet, nbtsock->sock->backend_name, io->in.dest_addr, io->in.dest_port); if (dest == NULL) goto failed; - req = nbt_name_request_send(nbtsock, dest, packet, + req = nbt_name_request_send(nbtsock, nbtsock, dest, packet, io->in.timeout, io->in.retries, false); if (req == NULL) goto failed; diff --git a/libcli/nbt/namerefresh.c b/libcli/nbt/namerefresh.c index b525356..b3aef76 100644 --- a/libcli/nbt/namerefresh.c +++ b/libcli/nbt/namerefresh.c @@ -72,7 +72,7 @@ struct nbt_name_request *nbt_name_refresh_send(struct nbt_name_socket *nbtsock, nbtsock->sock->backend_name, io->in.dest_addr, io->in.dest_port); if (dest == NULL) goto failed; - req = nbt_name_request_send(nbtsock, dest, packet, + req = nbt_name_request_send(nbtsock, nbtsock, dest, packet, io->in.timeout, io->in.retries, false); if (req == NULL) goto failed; diff --git a/libcli/nbt/nameregister.c b/libcli/nbt/nameregister.c index ff5418c..8e8271d 100644 --- a/libcli/nbt/nameregister.c +++ b/libcli/nbt/nameregister.c @@ -80,7 +80,7 @@ struct nbt_name_request *nbt_name_register_send(struct nbt_name_socket *nbtsock, dest = socket_address_from_strings(packet, nbtsock->sock->backend_name, io->in.dest_addr, io->in.dest_port); if (dest == NULL) goto failed; - req = nbt_name_request_send(nbtsock, dest, packet, + req = nbt_name_request_send(nbtsock, nbtsock, dest, packet, io->in.timeout, io->in.retries, false); if (req == NULL) goto failed; diff --git a/libcli/nbt/namerelease.c b/libcli/nbt/namerelease.c index 8f46981..68c8252 100644 --- a/libcli/nbt/namerelease.c +++ b/libcli/nbt/namerelease.c @@ -69,7 +69,7 @@ _PUBLIC_ struct nbt_name_request *nbt_name_release_send(struct nbt_name_socket * dest = socket_address_from_strings(packet, nbtsock->sock->backend_name, io->in.dest_addr, io->in.dest_port); if (dest == NULL) goto failed; - req = nbt_name_request_send(nbtsock, dest, packet, + req = nbt_name_request_send(nbtsock, nbtsock, dest, packet, io->in.timeout, io->in.retries, false); if (req == NULL) goto failed; diff --git a/libcli/nbt/nbt_proto.h b/libcli/nbt/nbt_proto.h index 281ce25..e6ee46b 100644 --- a/libcli/nbt/nbt_proto.h +++ b/libcli/nbt/nbt_proto.h @@ -33,7 +33,8 @@ /* The following definitions come from ../libcli/nbt/nbtsocket.c */ -struct nbt_name_request *nbt_name_request_send(struct nbt_name_socket *nbtsock, +struct nbt_name_request *nbt_name_request_send(TALLOC_CTX *mem_ctx, + struct nbt_name_socket *nbtsock, struct socket_address *dest, struct nbt_name_packet *request, int timeout, int retries, diff --git a/libcli/nbt/nbtsocket.c b/libcli/nbt/nbtsocket.c index 711e39c..33d53fb 100644 --- a/libcli/nbt/nbtsocket.c +++ b/libcli/nbt/nbtsocket.c @@ -367,7 +367,8 @@ failed: /* send off a nbt name request */ -struct nbt_name_request *nbt_name_request_send(struct nbt_name_socket *nbtsock, +struct nbt_name_request *nbt_name_request_send(TALLOC_CTX *mem_ctx, + struct nbt_name_socket *nbtsock, struct socket_address *dest, struct nbt_name_packet *request, int timeout, int retries, @@ -377,7 +378,7 @@ struct nbt_name_request *nbt_name_request_send(struct nbt_name_socket *nbtsock, int id; enum ndr_err_code ndr_err; - req = talloc_zero(nbtsock, struct nbt_name_request); + req = talloc_zero(mem_ctx, struct nbt_name_request); if (req == NULL) goto failed; req->nbtsock = nbtsock; @@ -526,7 +527,7 @@ NTSTATUS nbt_set_unexpected_handler(struct nbt_name_socket *nbtsock, */ _PUBLIC_ NTSTATUS nbt_rcode_to_ntstatus(uint8_t rcode) { - int i; + size_t i; struct { enum nbt_rcode rcode; NTSTATUS status; diff --git a/source4/libcli/dgram/mailslot.c b/source4/libcli/dgram/mailslot.c index 466c603..bae26e0 100644 --- a/source4/libcli/dgram/mailslot.c +++ b/source4/libcli/dgram/mailslot.c @@ -171,6 +171,7 @@ NTSTATUS dgram_mailslot_send(struct nbt_dgram_socket *dgmsock, packet.dgram_id = generate_random() % UINT16_MAX; src = socket_get_my_addr(dgmsock->sock, tmp_ctx); if (!src) { + talloc_free(tmp_ctx); return NT_STATUS_NO_MEMORY; } packet.src_addr = src->addr; -- Samba Shared Repository