Skip to content

Commit

Permalink
Fix asan failure
Browse files Browse the repository at this point in the history
  • Loading branch information
y-zeng committed Jan 21, 2017
1 parent e02cbeb commit 6a167b6
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 14 deletions.
1 change: 1 addition & 0 deletions src/core/ext/resolver/dns/c_ares/dns_resolver_ares.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ static void dns_ares_destroy(grpc_exec_ctx *exec_ctx, grpc_resolver *gr) {
if (r->resolved_result != NULL) {
grpc_channel_args_destroy(exec_ctx, r->resolved_result);
}
grpc_pollset_set_destroy(r->interested_parties);
gpr_free(r->name_to_resolve);
gpr_free(r->default_port);
grpc_channel_args_destroy(exec_ctx, r->channel_args);
Expand Down
10 changes: 5 additions & 5 deletions src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_fallback.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
*/

#include <grpc/support/port_platform.h>
#ifdef GRPC_NATIVE_ADDRESS_RESOLVE
#include "src/core/lib/iomgr/port.h"
#if !(GRPC_ARES == 1 && defined(GRPC_POSIX_SOCKET))

#include "src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver.h"

Expand All @@ -43,7 +44,7 @@ struct grpc_ares_ev_driver {
void grpc_ares_ev_driver_start(grpc_exec_ctx *exec_ctx,
grpc_ares_ev_driver *ev_driver) {}

void *grpc_ares_ev_driver_get_channel(grpc_ares_ev_driver *ev_driver) {
ares_channel *grpc_ares_ev_driver_get_channel(grpc_ares_ev_driver *ev_driver) {
return NULL;
}

Expand All @@ -52,7 +53,6 @@ grpc_error *grpc_ares_ev_driver_create(grpc_ares_ev_driver **ev_driver,
return GRPC_ERROR_NONE;
}

void grpc_ares_ev_driver_destroy(grpc_exec_ctx *exec_ctx,
grpc_ares_ev_driver *ev_driver) {}
void grpc_ares_ev_driver_destroy(grpc_ares_ev_driver *ev_driver) {}

#endif /* GRPC_NATIVE_ADDRESS_RESOLVE */
#endif /* !(GRPC_ARES == 1 && defined(GRPC_POSIX_SOCKET)) */
2 changes: 0 additions & 2 deletions src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@
#include "src/core/lib/iomgr/ev_posix.h"
#include "src/core/lib/iomgr/iomgr_internal.h"
#include "src/core/lib/iomgr/sockaddr_utils.h"
#include "src/core/lib/iomgr/unix_sockets_posix.h"
#include "src/core/lib/support/block_annotate.h"
#include "src/core/lib/support/string.h"

typedef struct fd_node {
Expand Down
3 changes: 0 additions & 3 deletions src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,12 @@
#include <grpc/support/host_port.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include <grpc/support/thd.h>
#include <grpc/support/time.h>
#include <grpc/support/useful.h>
#include "src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver.h"
#include "src/core/lib/iomgr/executor.h"
#include "src/core/lib/iomgr/iomgr_internal.h"
#include "src/core/lib/iomgr/sockaddr_utils.h"
#include "src/core/lib/iomgr/unix_sockets_posix.h"
#include "src/core/lib/support/block_annotate.h"
#include "src/core/lib/support/string.h"

static gpr_once g_basic_init = GPR_ONCE_INIT;
Expand Down
10 changes: 6 additions & 4 deletions src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper_fallback.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,23 @@
/* TODO(zyc): remove this fallback after we can build c-ares on windows */

#include <grpc/support/port_platform.h>
#ifdef GRPC_NATIVE_ADDRESS_RESOLVE
#if !(GRPC_ARES == 1)

#include "src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver.h"
#include "src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper.h"

void grpc_resolve_address_ares_impl(grpc_exec_ctx *exec_ctx, const char *name,
const char *default_port,
grpc_ares_ev_driver *ev_driver,
grpc_pollset_set *interested_parties,
grpc_closure *on_done,
grpc_resolved_addresses **addrs) {
grpc_resolve_address(exec_ctx, name, default_port, on_done, addrs);
grpc_resolve_address(exec_ctx, name, default_port, interested_parties,
on_done, addrs);
}

void (*grpc_resolve_address_ares)(
grpc_exec_ctx *exec_ctx, const char *name, const char *default_port,
grpc_ares_ev_driver *ev_driver, grpc_closure *on_done,
grpc_pollset_set *interested_parties, grpc_closure *on_done,
grpc_resolved_addresses **addrs) = grpc_resolve_address_ares_impl;

grpc_error *grpc_ares_init(void) { return GRPC_ERROR_NONE; }
Expand Down

0 comments on commit 6a167b6

Please sign in to comment.