aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/client_channel/uri_fuzzer_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/core/client_channel/uri_fuzzer_test.cc')
-rw-r--r--test/core/client_channel/uri_fuzzer_test.cc17
1 files changed, 12 insertions, 5 deletions
diff --git a/test/core/client_channel/uri_fuzzer_test.cc b/test/core/client_channel/uri_fuzzer_test.cc
index 484676e472..8f1f5e2eda 100644
--- a/test/core/client_channel/uri_fuzzer_test.cc
+++ b/test/core/client_channel/uri_fuzzer_test.cc
@@ -20,6 +20,7 @@
#include <stdint.h>
#include <string.h>
+#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include "src/core/ext/filters/client_channel/uri_parser.h"
@@ -33,12 +34,18 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
memcpy(s, data, size);
s[size] = 0;
- grpc_core::ExecCtx _local_exec_ctx;
- grpc_uri* x;
- if ((x = grpc_uri_parse(s, 1))) {
- grpc_uri_destroy(x);
+ grpc_init();
+
+ {
+ grpc_core::ExecCtx _local_exec_ctx;
+ grpc_uri* x;
+ if ((x = grpc_uri_parse(s, 1))) {
+ grpc_uri_destroy(x);
+ }
+
+ gpr_free(s);
}
- gpr_free(s);
+ grpc_shutdown();
return 0;
}