Fix error refcounting in on_handshake_done callbacks.

reviewable/pr8782/r1
Mark D. Roth 8 years ago
parent c560c5a7c5
commit 4f74d04547
  1. 2
      src/core/ext/transport/chttp2/client/insecure/channel_create.c
  2. 2
      src/core/ext/transport/chttp2/client/secure/secure_channel_create.c
  3. 1
      src/core/ext/transport/chttp2/server/insecure/server_chttp2.c
  4. 2
      src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.c

@ -110,7 +110,7 @@ static void on_handshake_done(grpc_exec_ctx *exec_ctx, void *arg,
gpr_free(args); gpr_free(args);
grpc_closure *notify = c->notify; grpc_closure *notify = c->notify;
c->notify = NULL; c->notify = NULL;
grpc_exec_ctx_sched(exec_ctx, notify, error, NULL); grpc_exec_ctx_sched(exec_ctx, notify, GRPC_ERROR_REF(error), NULL);
} }
static void connected(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { static void connected(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {

@ -138,7 +138,7 @@ static void on_handshake_done(grpc_exec_ctx *exec_ctx, void *arg,
gpr_free(args->read_buffer); gpr_free(args->read_buffer);
grpc_closure *notify = c->notify; grpc_closure *notify = c->notify;
c->notify = NULL; c->notify = NULL;
grpc_exec_ctx_sched(exec_ctx, notify, error, NULL); grpc_exec_ctx_sched(exec_ctx, notify, GRPC_ERROR_REF(error), NULL);
} else { } else {
// TODO(roth, jboeuf): Convert security connector handshaking to use new // TODO(roth, jboeuf): Convert security connector handshaking to use new
// handshake API, and then move the code from on_secure_handshake_done() // handshake API, and then move the code from on_secure_handshake_done()

@ -62,7 +62,6 @@ static void on_handshake_done(grpc_exec_ctx *exec_ctx, void *arg,
const char *error_str = grpc_error_string(error); const char *error_str = grpc_error_string(error);
gpr_log(GPR_ERROR, "Handshaking failed: %s", error_str); gpr_log(GPR_ERROR, "Handshaking failed: %s", error_str);
grpc_error_free_string(error_str); grpc_error_free_string(error_str);
GRPC_ERROR_UNREF(error);
grpc_handshake_manager_shutdown(exec_ctx, state->handshake_mgr); grpc_handshake_manager_shutdown(exec_ctx, state->handshake_mgr);
gpr_free(args->read_buffer); gpr_free(args->read_buffer);
} else { } else {

@ -123,8 +123,6 @@ static void on_handshake_done(grpc_exec_ctx *exec_ctx, void *arg,
const char *error_str = grpc_error_string(error); const char *error_str = grpc_error_string(error);
gpr_log(GPR_ERROR, "Handshaking failed: %s", error_str); gpr_log(GPR_ERROR, "Handshaking failed: %s", error_str);
grpc_error_free_string(error_str); grpc_error_free_string(error_str);
// FIXME: remove?
// GRPC_ERROR_UNREF(error);
grpc_channel_args_destroy(args->args); grpc_channel_args_destroy(args->args);
gpr_free(args->read_buffer); gpr_free(args->read_buffer);
gpr_free(args); gpr_free(args);

Loading…
Cancel
Save