diff options
author | Mark D. Roth <roth@google.com> | 2016-07-29 08:43:09 -0700 |
---|---|---|
committer | Mark D. Roth <roth@google.com> | 2016-07-29 08:43:09 -0700 |
commit | 8d7dc2772d7086d9ec6f71fb67f30e3b0c038eb3 (patch) | |
tree | 4981c869f3950573f9f208141ed198ede3d6244f /test/core | |
parent | 9f709a4a7e60e0fdc0e4cfdaaa70ee2d226a3100 (diff) |
Fix use-after-free and memory leak problems.
Diffstat (limited to 'test/core')
-rw-r--r-- | test/core/end2end/fixtures/http_proxy.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/test/core/end2end/fixtures/http_proxy.c b/test/core/end2end/fixtures/http_proxy.c index 975deaeb30..97aced3d1e 100644 --- a/test/core/end2end/fixtures/http_proxy.c +++ b/test/core/end2end/fixtures/http_proxy.c @@ -123,18 +123,12 @@ gpr_log(GPR_ERROR, "==> %s()", __func__); const char* msg = grpc_error_string(error); gpr_log(GPR_ERROR, "%s: %s", prefix, msg); grpc_error_free_string(msg); - GRPC_ERROR_UNREF(error); -gpr_log(GPR_ERROR, "HERE 0"); grpc_endpoint_shutdown(exec_ctx, cd->client_endpoint); -gpr_log(GPR_ERROR, "HERE 1"); if (cd->server_endpoint != NULL) grpc_endpoint_shutdown(exec_ctx, cd->server_endpoint); -gpr_log(GPR_ERROR, "HERE 2"); if (gpr_unref(&cd->refcount)) { -gpr_log(GPR_ERROR, "HERE 2.5"); connection_data_destroy(exec_ctx, cd); } -gpr_log(GPR_ERROR, "HERE 3"); } static void on_client_write_done(grpc_exec_ctx* exec_ctx, void* arg, @@ -365,6 +359,7 @@ gpr_log(GPR_ERROR, "Proxy address: %s", proxy->proxy_name); static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p, grpc_error *error) { grpc_pollset_destroy(p); + gpr_free(p); } // FIXME: remove (including all references below) @@ -397,24 +392,17 @@ gpr_log(GPR_ERROR, "==> %s()", __func__); grpc_end2end_http_proxy *proxy = arg; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; do { -gpr_log(GPR_ERROR, "HERE a"); const gpr_timespec now = gpr_now(GPR_CLOCK_MONOTONIC); const gpr_timespec deadline = gpr_time_add(now, gpr_time_from_seconds(5, GPR_TIMESPAN)); grpc_pollset_worker *worker = NULL; -gpr_log(GPR_ERROR, "HERE b"); gpr_mu_lock(proxy->mu); -gpr_log(GPR_ERROR, "HERE c"); GRPC_LOG_IF_ERROR("grpc_pollset_work", grpc_pollset_work(&exec_ctx, proxy->pollset, &worker, now, deadline)); -gpr_log(GPR_ERROR, "HERE d"); gpr_mu_unlock(proxy->mu); -gpr_log(GPR_ERROR, "HERE e"); grpc_exec_ctx_flush(&exec_ctx); -gpr_log(GPR_ERROR, "HERE f"); } while (!proxy->shutdown); -gpr_log(GPR_ERROR, "HERE g"); grpc_exec_ctx_finish(&exec_ctx); } |