projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
24c72b4
)
write_http: Added strdup() result check
author
Pavel Rochnyack
<pavel2000@ngs.ru>
Mon, 16 Oct 2017 12:05:20 +0000
(19:05 +0700)
committer
Pavel Rochnyack
<pavel2000@ngs.ru>
Mon, 16 Oct 2017 12:05:20 +0000
(19:05 +0700)
src/write_http.c
patch
|
blob
|
history
diff --git
a/src/write_http.c
b/src/write_http.c
index
c391e69
..
16a21e6
100644
(file)
--- a/
src/write_http.c
+++ b/
src/write_http.c
@@
-637,6
+637,12
@@
static int wh_config_node(oconfig_item_t *ci) /* {{{ */
cb->data_ttl = 0;
cb->metrics_prefix = strdup(WRITE_HTTP_DEFAULT_PREFIX);
+ if (cb->metrics_prefix == NULL) {
+ ERROR("write_http plugin: strdup failed.");
+ sfree(cb);
+ return -1;
+ }
+
pthread_mutex_init(&cb->send_lock, /* attr = */ NULL);
cf_util_get_string(ci, &cb->name);