projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
08d9675
)
write_stackdriver plugin: Check pointer for NULL before dereferencing it.
author
Florian Forster
<octo@collectd.org>
Thu, 18 Oct 2018 13:49:37 +0000
(15:49 +0200)
committer
Florian Forster
<ff@octo.it>
Thu, 18 Oct 2018 16:52:13 +0000
(18:52 +0200)
src/write_stackdriver.c
patch
|
blob
|
history
diff --git
a/src/write_stackdriver.c
b/src/write_stackdriver.c
index
9d06c25
..
421df2d
100644
(file)
--- a/
src/write_stackdriver.c
+++ b/
src/write_stackdriver.c
@@
-225,8
+225,10
@@
static int do_post(wg_callback_t *cb, char const *url, void const *payload,
if (status != CURLE_OK) {
ERROR("write_stackdriver plugin: POST %s failed: %s", url, cb->curl_errbuf);
- sfree(ret_content->memory);
- ret_content->size = 0;
+ if (ret_content != NULL) {
+ sfree(ret_content->memory);
+ ret_content->size = 0;
+ }
return -1;
}