projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
write_http plugin: Be extra conservative in wh_reset_buffer().
[collectd.git]
/
src
/
write_http.c
diff --git
a/src/write_http.c
b/src/write_http.c
index
3d50be5
..
ec538b6
100644
(file)
--- a/
src/write_http.c
+++ b/
src/write_http.c
@@
-95,6
+95,9
@@
static void wh_log_http_error (wh_callback_t *cb)
static void wh_reset_buffer (wh_callback_t *cb) /* {{{ */
{
static void wh_reset_buffer (wh_callback_t *cb) /* {{{ */
{
+ if ((cb == NULL) || (cb->send_buffer == NULL))
+ return;
+
memset (cb->send_buffer, 0, cb->send_buffer_size);
cb->send_buffer_free = cb->send_buffer_size;
cb->send_buffer_fill = 0;
memset (cb->send_buffer, 0, cb->send_buffer_size);
cb->send_buffer_free = cb->send_buffer_size;
cb->send_buffer_fill = 0;
@@
-320,7
+323,8
@@
static void wh_callback_free (void *data) /* {{{ */
cb = data;
cb = data;
- wh_flush_nolock (/* timeout = */ 0, cb);
+ if (cb->send_buffer != NULL)
+ wh_flush_nolock (/* timeout = */ 0, cb);
if (cb->curl != NULL)
{
if (cb->curl != NULL)
{