Merge pull request #15007 from adelez/foundry_integration

Fix a memory leak
pull/15015/head
adelez 7 years ago committed by GitHub
commit 074439e7d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      test/core/util/fuzzer_corpus_test.cc
  2. 5
      test/cpp/naming/resolver_component_tests_runner_invoker.cc
  3. 3
      test/cpp/util/grpc_tool_test.cc

@ -20,6 +20,7 @@
#include <dirent.h> #include <dirent.h>
#include <gflags/gflags.h> #include <gflags/gflags.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <stdio.h> #include <stdio.h>
@ -91,6 +92,7 @@ class ExampleGenerator
perror("Couldn't open the directory"); perror("Couldn't open the directory");
abort(); abort();
} }
gpr_free(test_srcdir);
} }
} }
} }

@ -165,9 +165,9 @@ int main(int argc, char** argv) {
GPR_ASSERT(FLAGS_grpc_test_directory_relative_to_test_srcdir != ""); GPR_ASSERT(FLAGS_grpc_test_directory_relative_to_test_srcdir != "");
// Use bazel's TEST_SRCDIR environment variable to locate the "test data" // Use bazel's TEST_SRCDIR environment variable to locate the "test data"
// binaries. // binaries.
char* test_srcdir = gpr_getenv("TEST_SRCDIR");
std::string const bin_dir = std::string const bin_dir =
gpr_getenv("TEST_SRCDIR") + test_srcdir + FLAGS_grpc_test_directory_relative_to_test_srcdir +
FLAGS_grpc_test_directory_relative_to_test_srcdir +
std::string("/test/cpp/naming"); std::string("/test/cpp/naming");
// Invoke bazel's executeable links to the .sh and .py scripts (don't use // Invoke bazel's executeable links to the .sh and .py scripts (don't use
// the .sh and .py suffixes) to make // the .sh and .py suffixes) to make
@ -177,6 +177,7 @@ int main(int argc, char** argv) {
bin_dir + "/" + FLAGS_test_bin_name, bin_dir + "/utils/dns_server", bin_dir + "/" + FLAGS_test_bin_name, bin_dir + "/utils/dns_server",
bin_dir + "/resolver_test_record_groups.yaml", bin_dir + "/resolver_test_record_groups.yaml",
bin_dir + "/utils/dns_resolver", bin_dir + "/utils/tcp_connect"); bin_dir + "/utils/dns_resolver", bin_dir + "/utils/tcp_connect");
gpr_free(test_srcdir);
} else { } else {
// Get the current binary's directory relative to repo root to invoke the // Get the current binary's directory relative to repo root to invoke the
// correct build config (asan/tsan/dbg, etc.). // correct build config (asan/tsan/dbg, etc.).

@ -22,6 +22,7 @@
#include <gflags/gflags.h> #include <gflags/gflags.h>
#include <grpc/grpc.h> #include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpcpp/channel.h> #include <grpcpp/channel.h>
#include <grpcpp/client_context.h> #include <grpcpp/client_context.h>
#include <grpcpp/create_channel.h> #include <grpcpp/create_channel.h>
@ -738,6 +739,8 @@ TEST_F(GrpcToolTest, CallCommandWithBadMetadata) {
FLAGS_metadata = ""; FLAGS_metadata = "";
FLAGS_protofiles = ""; FLAGS_protofiles = "";
gpr_free(test_srcdir);
} }
} // namespace testing } // namespace testing

Loading…
Cancel
Save