summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3bfaa62)
raw | patch | inline | side by side (parent: 3bfaa62)
author | Florian Forster <octo@collectd.org> | |
Thu, 28 Jul 2016 13:20:37 +0000 (15:20 +0200) | ||
committer | Florian Forster <octo@collectd.org> | |
Thu, 28 Jul 2016 13:20:37 +0000 (15:20 +0200) |
src/grpc.cc | patch | blob | history |
diff --git a/src/grpc.cc b/src/grpc.cc
index a1dac35bb6db0b8bb49c6ad4d78c805051a8091d..05ab82114fb7327be18c69b00923ff26d477a2a0 100644 (file)
--- a/src/grpc.cc
+++ b/src/grpc.cc
while (uc_iterator_next(iter, &name) == 0) {
value_list_t res;
- if (parse_identifier_vl(name, &res) != 0)
+ if (parse_identifier_vl(name, &res) != 0) {
+ uc_iterator_destroy(iter);
return grpc::Status(grpc::StatusCode::INTERNAL,
grpc::string("failed to parse identifier"));
+ }
if (!ident_matches(&res, &matcher))
continue;
- if (uc_iterator_get_time(iter, &res.time) < 0)
+ if (uc_iterator_get_time(iter, &res.time) < 0) {
+ uc_iterator_destroy(iter);
return grpc::Status(grpc::StatusCode::INTERNAL,
grpc::string("failed to retrieve value timestamp"));
- if (uc_iterator_get_interval(iter, &res.interval) < 0)
+ }
+ if (uc_iterator_get_interval(iter, &res.interval) < 0) {
+ uc_iterator_destroy(iter);
return grpc::Status(grpc::StatusCode::INTERNAL,
grpc::string("failed to retrieve value interval"));
- if (uc_iterator_get_values(iter, &res.values, &res.values_len) < 0)
+ }
+ if (uc_iterator_get_values(iter, &res.values, &res.values_len) < 0) {
+ uc_iterator_destroy(iter);
return grpc::Status(grpc::StatusCode::INTERNAL,
grpc::string("failed to retrieve values"));
+ }
auto vl = reply->add_values();
status = marshal_value_list(&res, vl);
free(res.values);
- if (!status.ok())
+ if (!status.ok()) {
+ uc_iterator_destroy(iter);
return status;
+ }
}
uc_iterator_destroy(iter);