diff options
Diffstat (limited to 'source4/libcli/resolve/resolve.c')
-rw-r--r-- | source4/libcli/resolve/resolve.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/source4/libcli/resolve/resolve.c b/source4/libcli/resolve/resolve.c index 0ad3a75e89..77f7f4f46b 100644 --- a/source4/libcli/resolve/resolve.c +++ b/source4/libcli/resolve/resolve.c @@ -27,6 +27,7 @@ #include "system/network.h" #include "lib/socket/socket.h" #include "../lib/util/dlinklist.h" +#include "lib/tsocket/tsocket.h" struct resolve_state { struct resolve_context *ctx; @@ -145,7 +146,7 @@ struct composite_context *resolve_name_all_send(struct resolve_context *ctx, struct composite_context *c; struct resolve_state *state; - if (ctx == NULL || event_ctx == NULL) { + if (event_ctx == NULL) { return NULL; } @@ -239,8 +240,16 @@ NTSTATUS resolve_name_recv(struct composite_context *c, status = resolve_name_all_recv(c, mem_ctx, &addrs, NULL); if (NT_STATUS_IS_OK(status)) { - *reply_addr = talloc_steal(mem_ctx, addrs[0]->addr); + struct tsocket_address *t_addr = socket_address_to_tsocket_address(addrs, addrs[0]); + if (!t_addr) { + return NT_STATUS_NO_MEMORY; + } + + *reply_addr = tsocket_address_inet_addr_string(t_addr, mem_ctx); talloc_free(addrs); + if (!*reply_addr) { + return NT_STATUS_NO_MEMORY; + } } return status; |