diff options
author | Craig Tiller <ctiller@google.com> | 2016-04-15 13:36:25 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2016-04-15 13:36:25 -0700 |
commit | 3e0d936100965bd0bee53478b795a96240312110 (patch) | |
tree | 8ba0b61664a5262b6201a97dc4adc1a526939082 /test/core | |
parent | a225c29066fb900601fd9c893a94d8409c41ab14 (diff) |
Fix loop
Diffstat (limited to 'test/core')
-rw-r--r-- | test/core/end2end/fuzzers/api_fuzzer.c | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/test/core/end2end/fuzzers/api_fuzzer.c b/test/core/end2end/fuzzers/api_fuzzer.c index 7b107d2bc3..f9e74310da 100644 --- a/test/core/end2end/fuzzers/api_fuzzer.c +++ b/test/core/end2end/fuzzers/api_fuzzer.c @@ -635,22 +635,23 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { } op->reserved = NULL; op->flags = read_uint32(&inp); - if (ok) { - validator *v = create_validator(decrement, &pending_ops); - pending_ops++; - grpc_call_error error = grpc_call_start_batch( - on_server ? calls[0].server : calls[0].client, ops, num_ops, - v, NULL); - if (error != GRPC_CALL_OK) { - v->validate(v->arg, false); - gpr_free(v); - } - } else { - end(&inp); + } + if (ok) { + validator *v = create_validator(decrement, &pending_ops); + pending_ops++; + grpc_call_error error = grpc_call_start_batch( + on_server ? calls[0].server : calls[0].client, ops, num_ops, + v, NULL); + if (error != GRPC_CALL_OK) { + v->validate(v->arg, false); + gpr_free(v); } - for (i = 0; i < num_ops; i++) { - op = &ops[i]; - switch (op->op) { + } else { + end(&inp); + } + for (i = 0; i < num_ops; i++) { + op = &ops[i]; + switch (op->op) { case GRPC_OP_SEND_INITIAL_METADATA: for (size_t j = 0; j < op->data.send_initial_metadata.count; j++) { gpr_free((void*)op->data.send_initial_metadata.metadata[j].key); @@ -675,10 +676,10 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { case GRPC_OP_RECV_STATUS_ON_CLIENT: case GRPC_OP_RECV_CLOSE_ON_SERVER: break; - } } - gpr_free(ops); } + gpr_free(ops); + break; } // cancel current call on client |