summaryrefslogtreecommitdiffstats
path: root/exporting/opentsdb
diff options
context:
space:
mode:
authorthiagoftsm <thiagoftsm@gmail.com>2020-05-26 12:50:04 +0000
committerGitHub <noreply@github.com>2020-05-26 12:50:04 +0000
commit605705a164e2ef562b7b309cf5607918978bc039 (patch)
tree87293864686799504e70412f88da49f2f7545754 /exporting/opentsdb
parentba47e197056601c7db3ce8db0db277d155e8118a (diff)
Missing checks exporting (#9034)
Add tests to uv_mutex_init and uv_cond_init inside exporting.
Diffstat (limited to 'exporting/opentsdb')
-rw-r--r--exporting/opentsdb/opentsdb.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/exporting/opentsdb/opentsdb.c b/exporting/opentsdb/opentsdb.c
index cf55713ed8..41aa43e41b 100644
--- a/exporting/opentsdb/opentsdb.c
+++ b/exporting/opentsdb/opentsdb.c
@@ -37,8 +37,10 @@ int init_opentsdb_telnet_instance(struct instance *instance)
error("EXPORTING: cannot create buffer for opentsdb telnet exporting connector instance %s", instance->config.name);
return 1;
}
- uv_mutex_init(&instance->mutex);
- uv_cond_init(&instance->cond_var);
+ if (uv_mutex_init(&instance->mutex))
+ return 1;
+ if (uv_cond_init(&instance->cond_var))
+ return 1;
return 0;
}
@@ -78,8 +80,10 @@ int init_opentsdb_http_instance(struct instance *instance)
error("EXPORTING: cannot create buffer for opentsdb HTTP exporting connector instance %s", instance->config.name);
return 1;
}
- uv_mutex_init(&instance->mutex);
- uv_cond_init(&instance->cond_var);
+ if (uv_mutex_init(&instance->mutex))
+ return 1;
+ if (uv_cond_init(&instance->cond_var))
+ return 1;
return 0;
}