From 4e4033650911582617049643fb02942a114be220 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Wed, 1 Jul 2015 16:45:34 -0700 Subject: Fixed leaks --- test/core/end2end/fixtures/chttp2_fullstack_compression.c | 9 ++++++++- test/core/end2end/tests/invoke_large_request.c | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/core/end2end/fixtures/chttp2_fullstack_compression.c b/test/core/end2end/fixtures/chttp2_fullstack_compression.c index fb63d265a1..0124543c34 100644 --- a/test/core/end2end/fixtures/chttp2_fullstack_compression.c +++ b/test/core/end2end/fixtures/chttp2_fullstack_compression.c @@ -64,10 +64,11 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack_compression( int port = grpc_pick_unused_port_or_die(); fullstack_compression_fixture_data *ffd = gpr_malloc(sizeof(fullstack_compression_fixture_data)); - memset(&f, 0, sizeof(f)); + memset(ffd, 0, sizeof(fullstack_compression_fixture_data)); gpr_join_host_port(&ffd->localaddr, "localhost", port); + memset(&f, 0, sizeof(f)); f.fixture_data = ffd; f.cq = grpc_completion_queue_create(); @@ -77,6 +78,9 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack_compression( void chttp2_init_client_fullstack_compression(grpc_end2end_test_fixture *f, grpc_channel_args *client_args) { fullstack_compression_fixture_data *ffd = f->fixture_data; + if (ffd->client_args_compression != NULL) { + grpc_channel_args_destroy(ffd->client_args_compression); + } ffd->client_args_compression = grpc_channel_args_set_compression_level( client_args, GRPC_COMPRESS_LEVEL_HIGH); f->client = grpc_channel_create(ffd->localaddr, ffd->client_args_compression); @@ -85,6 +89,9 @@ void chttp2_init_client_fullstack_compression(grpc_end2end_test_fixture *f, void chttp2_init_server_fullstack_compression(grpc_end2end_test_fixture *f, grpc_channel_args *server_args) { fullstack_compression_fixture_data *ffd = f->fixture_data; + if (ffd->server_args_compression != NULL) { + grpc_channel_args_destroy(ffd->server_args_compression); + } ffd->server_args_compression = grpc_channel_args_set_compression_level( server_args, GRPC_COMPRESS_LEVEL_HIGH); if (f->server) { diff --git a/test/core/end2end/tests/invoke_large_request.c b/test/core/end2end/tests/invoke_large_request.c index 16dd164ea5..744a9ada57 100644 --- a/test/core/end2end/tests/invoke_large_request.c +++ b/test/core/end2end/tests/invoke_large_request.c @@ -228,6 +228,7 @@ static void test_invoke_large_request(grpc_end2end_test_config config) { grpc_byte_buffer_destroy(response_payload); grpc_byte_buffer_destroy(request_payload_recv); grpc_byte_buffer_destroy(response_payload_recv); + gpr_slice_unref(request_payload_slice); gpr_slice_unref(response_payload_slice); end_test(&f); -- cgit v1.2.3